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

Side by Side Diff: packages/convert/test/string_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/test/percent_test.dart ('k') | packages/crypto/.gitignore » ('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 StringAccumulatorSink();
12 });
13
14 test("provides access to the concatenated string", () {
15 expect(sink.string, isEmpty);
16
17 sink.add("foo");
18 expect(sink.string, equals("foo"));
19
20 sink.addSlice(" bar baz", 1, 4, false);
21 expect(sink.string, equals("foobar"));
22 });
23
24 test("clear() clears the string", () {
25 sink.add("foo");
26 expect(sink.string, equals("foo"));
27
28 sink.clear();
29 expect(sink.string, isEmpty);
30
31 sink.add("bar");
32 expect(sink.string, equals("bar"));
33 });
34
35 test("indicates whether the sink is closed", () {
36 expect(sink.isClosed, isFalse);
37 sink.close();
38 expect(sink.isClosed, isTrue);
39 });
40
41 test("indicates whether the sink is closed via addSlice", () {
42 expect(sink.isClosed, isFalse);
43 sink.addSlice("", 0, 0, true);
44 expect(sink.isClosed, isTrue);
45 });
46
47 test("doesn't allow add() to be called after close()", () {
48 sink.close();
49 expect(() => sink.add("x"), throwsStateError);
50 });
51
52 test("doesn't allow addSlice() to be called after close()", () {
53 sink.close();
54 expect(() => sink.addSlice("", 0, 0, false), throwsStateError);
55 });
56 }
OLDNEW
« no previous file with comments | « packages/convert/test/percent_test.dart ('k') | packages/crypto/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698