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

Unified Diff: tests/lib/async/stream_subscription_as_future_test.dart

Issue 2656503004: Revert "Remove package:unittest from some tests" (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/async/stream_state_test.dart ('k') | tests/lib/async/stream_subscription_cancel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_subscription_as_future_test.dart
diff --git a/tests/lib/async/stream_subscription_as_future_test.dart b/tests/lib/async/stream_subscription_as_future_test.dart
index dfb4ec09cd8f513a81b7dd7c32aa0ee8f5fb068f..841298b1990339a5440dff21a6bb59d35b4307e8 100644
--- a/tests/lib/async/stream_subscription_as_future_test.dart
+++ b/tests/lib/async/stream_subscription_as_future_test.dart
@@ -5,8 +5,9 @@
// Test the Stream.single method.
library stream_single_test;
+import "package:expect/expect.dart";
import 'dart:async';
-import 'package:test/test.dart';
+import 'package:unittest/unittest.dart';
main() {
test("subscription.asFuture success", () {
@@ -14,7 +15,7 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture(output).then(expectAsync((o) {
- expect([1, 2, 3], equals(o));
+ Expect.listEquals([1, 2, 3], o);
}));
});
@@ -26,7 +27,7 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture(output).then(expectAsync((o) {
- expect([1, 2, 3], equals(o));
+ Expect.listEquals([1, 2, 3], o);
}));
});
@@ -35,7 +36,7 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture(output).then(expectAsync((o) {
- expect([1, 2, 3], equals(o));
+ Expect.listEquals([1, 2, 3], o);
}));
});
@@ -45,8 +46,8 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture("string").then((String o) {
- expect([1, 2, 3], equals(output));
- expect("string", equals(o));
+ Expect.listEquals([1, 2, 3], output);
+ Expect.equals("string", o);
asyncCallback();
});
});
@@ -60,7 +61,7 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture(output).catchError(expectAsync((error) {
- expect(error, equals("foo"));
+ Expect.equals(error, "foo");
}));
});
@@ -73,7 +74,7 @@ main() {
var output = [];
var subscription = stream.listen((x) { output.add(x); });
subscription.asFuture(output).catchError(expectAsync((error) {
- expect(error, equals("foo"));
+ Expect.equals(error, "foo");
}));
});
@@ -89,11 +90,11 @@ main() {
var subscription = stream.listen((x) { output.add(x); });
bool catchErrorHasRun = false;
subscription.asFuture(output).catchError(expectAsync((error) {
- expect(error, equals("foo"));
+ Expect.equals(error, "foo");
catchErrorHasRun = true;
}));
Timer.run(expectAsync(() {
- expect(catchErrorHasRun, isFalse);
+ Expect.isFalse(catchErrorHasRun);
completer.complete();
}));
});
@@ -111,15 +112,15 @@ main() {
var subscription = stream.listen((x) { output.add(x); });
bool catchErrorHasRun = false;
subscription.asFuture(output).catchError(expectAsync((error) {
- expect(error, equals("foo"));
+ Expect.equals(error, "foo");
catchErrorHasRun = true;
}));
Timer.run(expectAsync(() {
- expect(catchErrorHasRun, isFalse);
+ Expect.isFalse(catchErrorHasRun);
completer.completeError(499);
}));
}, onError: expectAsync((e) {
- expect(499, equals(e));
+ Expect.equals(499, e);
}));
});
}
« no previous file with comments | « tests/lib/async/stream_state_test.dart ('k') | tests/lib/async/stream_subscription_cancel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698