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

Unified Diff: pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart

Issue 196063004: Move dart2js entrypoint detection into isPrimary. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use dart2js error messages Created 6 years, 9 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
Index: pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart
diff --git a/pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart b/pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart
index 93c6b43cf4d02309417e15d5e33690f95e1a03b9..d7127443d0e50b94277bd7c31205ea5660f56779 100644
--- a/pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart
+++ b/pkg/scheduled_test/test/scheduled_stream/stream_matcher_test.dart
@@ -183,23 +183,25 @@ void main(_, message) {
expectTestPasses("consumeThrough() consumes values through the given matcher",
() {
var stream = createStream();
- stream.expect(consumeThrough(greaterThan(2)));
+ stream.expect(consumeThrough(inOrder([2, 3])));
stream.expect(4);
});
expectTestPasses("consumeThrough() will stop if the first value matches", () {
var stream = createStream();
- stream.expect(consumeThrough(1));
- stream.expect(2);
+ stream.expect(consumeThrough(inOrder([1, 2])));
+ stream.expect(3);
});
expectTestFails("consumeThrough() will fail if the stream ends before the "
"value is reached", () {
- createStream().expect(consumeThrough(100));
+ createStream().expect(consumeThrough(inOrder([5, 6])));
}, (errors) {
expect(errors, hasLength(1));
expect(errors.first.error.message, equals(
- "Expected: values followed by <100>\n"
+ "Expected: values followed by:\n"
+ " | * <5>\n"
+ " | * <6>\n"
" Emitted: * 1\n"
" * 2\n"
" * 3\n"
@@ -215,10 +217,16 @@ void main(_, message) {
stream.expect(4);
});
+ expectTestPasses("consumeWhile() consumes values in chunks", () {
+ var stream = createStream();
+ stream.expect(consumeWhile(inOrder([anything, anything])));
+ stream.expect(5);
+ });
+
expectTestPasses("consumeWhile() will stop if the first value doesn't match",
() {
var stream = createStream();
- stream.expect(consumeWhile(2));
+ stream.expect(consumeWhile(inOrder([2, 3])));
stream.expect(1);
});

Powered by Google App Engine
This is Rietveld 408576698