terminal_isolate_test.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // import 'dart:async';
  2. // import 'package:flutter_test/flutter_test.dart';
  3. // import 'package:xterm/terminal/terminal_backend.dart';
  4. // import 'package:xterm/terminal/terminal_isolate.dart';
  5. void main() {
  6. // group('Start behavior tests', () {
  7. // test('Using TerminalIsolate when not started throws exception', () {
  8. // final fixture = _TestFixture();
  9. // expect(() => fixture.uut.terminalWidth, throwsA(isA<Exception>()));
  10. // });
  11. // test('Using TerminalIsolate after started doesn\'t throw exceptions',
  12. // () async {
  13. // final fixture = _TestFixture();
  14. // await fixture.uut.start(testingDontWaitForBootup: true);
  15. // //no throw
  16. // fixture.uut.showCursor;
  17. // });
  18. // });
  19. }
  20. // class _TestFixture {
  21. // _TestFixture() {
  22. // fakeBackend = FakeBackend();
  23. // uut = TerminalIsolate(maxLines: 10000, backend: fakeBackend);
  24. // }
  25. // late final TerminalIsolate uut;
  26. // late final FakeBackend fakeBackend;
  27. // }
  28. // class FakeBackend implements TerminalBackend {
  29. // @override
  30. // void ackProcessed() {}
  31. // @override
  32. // // TODO: implement exitCode
  33. // Future<int> get exitCode => _exitCodeCompleter.future;
  34. // @override
  35. // void init() {
  36. // _exitCodeCompleter = Completer<int>();
  37. // _outStream = StreamController<String>();
  38. // _hasInitBeenCalled = true;
  39. // }
  40. // @override
  41. // Stream<String> get out => _outStream.stream;
  42. // @override
  43. // void resize(int width, int height, int pixelWidth, int pixelHeight) {
  44. // _width = width;
  45. // _height = height;
  46. // _pixelWidth = pixelWidth;
  47. // _pixelHeight = pixelHeight;
  48. // }
  49. // @override
  50. // void terminate() {
  51. // _isTerminated = true;
  52. // }
  53. // @override
  54. // void write(String _) {}
  55. // bool get hasInitBeenCalled => _hasInitBeenCalled;
  56. // bool get isTerminated => _isTerminated;
  57. // int? get width => _width;
  58. // int? get height => _height;
  59. // int? get pixelWidth => _pixelWidth;
  60. // int? get pixelHeight => _pixelHeight;
  61. // bool _hasInitBeenCalled = false;
  62. // bool _isTerminated = false;
  63. // int? _width;
  64. // int? _height;
  65. // int? _pixelWidth;
  66. // int? _pixelHeight;
  67. // late final _exitCodeCompleter;
  68. // late final _outStream;
  69. // }