OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | |
6 | |
7 import 'package:convert/convert.dart'; | 5 import 'package:convert/convert.dart'; |
8 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
9 | 7 |
10 void main() { | 8 void main() { |
11 var sink; | 9 var sink; |
12 setUp(() { | 10 setUp(() { |
13 sink = new AccumulatorSink<int>(); | 11 sink = new AccumulatorSink<int>(); |
14 }); | 12 }); |
15 | 13 |
16 test("provides access to events as they're added", () { | 14 test("provides access to events as they're added", () { |
(...skipping 24 matching lines...) Expand all Loading... |
41 expect(sink.isClosed, isFalse); | 39 expect(sink.isClosed, isFalse); |
42 sink.close(); | 40 sink.close(); |
43 expect(sink.isClosed, isTrue); | 41 expect(sink.isClosed, isTrue); |
44 }); | 42 }); |
45 | 43 |
46 test("doesn't allow add() to be called after close()", () { | 44 test("doesn't allow add() to be called after close()", () { |
47 sink.close(); | 45 sink.close(); |
48 expect(() => sink.add(1), throwsStateError); | 46 expect(() => sink.add(1), throwsStateError); |
49 }); | 47 }); |
50 } | 48 } |
OLD | NEW |