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

Side by Side Diff: test/codegen/lib/convert/close_test.dart

Issue 1965563003: Update dart:convert and dart:core Uri. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
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:expect/expect.dart";
6 import "dart:convert";
7
8 class MySink implements Sink<List<int>> {
9 List<int> accumulated = <int>[];
10 bool isClosed = false;
11
12 add(List<int> list) {
13 accumulated.addAll(list);
14 list.length;
15 }
16
17 close() {
18 isClosed = true;
19 }
20 }
21
22 main() {
23 var mySink = new MySink();
24 var byteSink = new ByteConversionSink.from(mySink);
25 byteSink.add([1, 2, 3]);
26 byteSink.close();
27 Expect.listEquals([1, 2, 3], mySink.accumulated);
28 Expect.isTrue(mySink.isClosed);
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698