Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: packages/convert/test/accumulator_sink_test.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packages/convert/pubspec.yaml ('k') | packages/convert/test/byte_accumulator_sink_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:convert/convert.dart';
6 import 'package:test/test.dart';
7
8 void main() {
9 var sink;
10 setUp(() {
11 sink = new AccumulatorSink<int>();
12 });
13
14 test("provides access to events as they're added", () {
15 expect(sink.events, isEmpty);
16
17 sink.add(1);
18 expect(sink.events, equals([1]));
19
20 sink.add(2);
21 expect(sink.events, equals([1, 2]));
22
23 sink.add(3);
24 expect(sink.events, equals([1, 2, 3]));
25 });
26
27 test("clear() clears the events", () {
28 sink..add(1)..add(2)..add(3);
29 expect(sink.events, equals([1, 2, 3]));
30
31 sink.clear();
32 expect(sink.events, isEmpty);
33
34 sink..add(4)..add(5)..add(6);
35 expect(sink.events, equals([4, 5, 6]));
36 });
37
38 test("indicates whether the sink is closed", () {
39 expect(sink.isClosed, isFalse);
40 sink.close();
41 expect(sink.isClosed, isTrue);
42 });
43
44 test("doesn't allow add() to be called after close()", () {
45 sink.close();
46 expect(() => sink.add(1), throwsStateError);
47 });
48 }
OLDNEW
« no previous file with comments | « packages/convert/pubspec.yaml ('k') | packages/convert/test/byte_accumulator_sink_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698