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

Side by Side Diff: tests/lib/async/stream_single_to_multi_subscriber_test.dart

Issue 2656503004: Revert "Remove package:unittest from some tests" (Closed)
Patch Set: Created 3 years, 10 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 | « tests/lib/async/stream_single_test.dart ('k') | tests/lib/async/stream_state_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Test the basic StreamController and StreamController.singleSubscription. 5 // Test the basic StreamController and StreamController.singleSubscription.
6 library stream_single_test; 6 library stream_single_test;
7 7
8 import "package:expect/expect.dart";
8 import 'dart:async'; 9 import 'dart:async';
9 import 'package:test/test.dart'; 10 import 'package:unittest/unittest.dart';
10 import 'event_helper.dart'; 11 import 'event_helper.dart';
11 12
12 main() { 13 main() {
13 test("tomulti 1", () { 14 test("tomulti 1", () {
14 StreamController c = new StreamController<int>(sync: true); 15 StreamController c = new StreamController<int>(sync: true);
15 Stream<int> multi = c.stream.asBroadcastStream(); 16 Stream<int> multi = c.stream.asBroadcastStream();
16 // Listen twice. 17 // Listen twice.
17 multi.listen(expectAsync((v) => expect(42, equals(v)))); 18 multi.listen(expectAsync((v) => Expect.equals(42, v)));
18 multi.listen(expectAsync((v) => expect(42, equals(v)))); 19 multi.listen(expectAsync((v) => Expect.equals(42, v)));
19 c.add(42); 20 c.add(42);
20 }); 21 });
21 22
22 test("tomulti 2", () { 23 test("tomulti 2", () {
23 StreamController c = new StreamController<int>(sync: true); 24 StreamController c = new StreamController<int>(sync: true);
24 Stream<int> multi = c.stream.asBroadcastStream(); 25 Stream<int> multi = c.stream.asBroadcastStream();
25 Events expected = new Events.fromIterable([1, 2, 3, 4, 5]); 26 Events expected = new Events.fromIterable([1, 2, 3, 4, 5]);
26 Events actual1 = new Events.capture(multi); 27 Events actual1 = new Events.capture(multi);
27 Events actual2 = new Events.capture(multi); 28 Events actual2 = new Events.capture(multi);
28 actual1.onDone(expectAsync(() { 29 actual1.onDone(expectAsync(() {
29 expect(expected.events, equals(actual1.events)); 30 Expect.listEquals(expected.events, actual1.events);
30 })); 31 }));
31 actual2.onDone(expectAsync(() { 32 actual2.onDone(expectAsync(() {
32 expect(expected.events, equals(actual2.events)); 33 Expect.listEquals(expected.events, actual2.events);
33 })); 34 }));
34 expected.replay(c); 35 expected.replay(c);
35 }); 36 });
36 37
37 test("tomulti no-op", () { 38 test("tomulti no-op", () {
38 StreamController c = new StreamController<int>(sync: true); 39 StreamController c = new StreamController<int>(sync: true);
39 Stream<int> multi = c.stream.asBroadcastStream(); 40 Stream<int> multi = c.stream.asBroadcastStream();
40 Events expected = new Events.fromIterable([1, 2, 3, 4, 5]); 41 Events expected = new Events.fromIterable([1, 2, 3, 4, 5]);
41 Events actual1 = new Events.capture(multi); 42 Events actual1 = new Events.capture(multi);
42 Events actual2 = new Events.capture(multi); 43 Events actual2 = new Events.capture(multi);
43 actual1.onDone(expectAsync(() { 44 actual1.onDone(expectAsync(() {
44 expect(expected.events, equals(actual1.events)); 45 Expect.listEquals(expected.events, actual1.events);
45 })); 46 }));
46 actual2.onDone(expectAsync(() { 47 actual2.onDone(expectAsync(() {
47 expect(expected.events, equals(actual2.events)); 48 Expect.listEquals(expected.events, actual2.events);
48 })); 49 }));
49 expected.replay(c); 50 expected.replay(c);
50 }); 51 });
51 } 52 }
OLDNEW
« no previous file with comments | « tests/lib/async/stream_single_test.dart ('k') | tests/lib/async/stream_state_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698