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

Unified Diff: tests/html/streams_test.dart

Issue 12061002: Fixing type check error using Stream.take in dart2js checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/streams_test.dart
diff --git a/tests/html/streams_test.dart b/tests/html/streams_test.dart
index 07d77a64c390668f3b9bf3524e380c5c0940c5e7..726764547e6909837bdd1424fab97fdba932d061 100644
--- a/tests/html/streams_test.dart
+++ b/tests/html/streams_test.dart
@@ -169,4 +169,111 @@ main() {
helper.pulse();
expect(callCountOne, 1);
});
+
+ var stream = new StreamHelper().stream;
+ // Streams have had some type-checking issues, these tests just validate that
+ // those are OK.
+ test('first', () {
+ stream.first.then((_) {});
+ });
+
+ test('asBroadcastStream', () {
+ stream.asBroadcastStream().listen((_) {});
+ });
+
+ test('where', () {
+ stream.where((_) => true).listen((_) {});
+ });
+
+ test('mappedBy', () {
+ stream.mappedBy((_) => null).listen((_) {});
+ });
+
+ test('reduce', () {
+ stream.reduce(null, (_) => null).then((_) {});
+ });
+
+ test('contains', () {
+ stream.contains((_) => true).then((_) {});
+ });
+
+ test('every', () {
+ stream.every((_) => true).then((_) {});
+ });
+
+ test('any', () {
+ stream.any((_) => true).then((_) {});
+ });
+
+ test('length', () {
+ stream.length.then((_) {});
+ });
+
+ test('min', () {
+ stream.min((a, b) => 0).then((_) {});
+ });
+
+ test('max', () {
+ stream.max((a, b) => 0).then((_) {});
+ });
+
+ test('isEmpty', () {
+ stream.isEmpty.then((_) {});
+ });
+
+ test('toList', () {
+ stream.toList().then((_) {});
+ });
+
+ test('toSet', () {
+ stream.toSet().then((_) {});
+ });
+
+ test('take', () {
+ stream.take(1).listen((_) {});
+ });
+
+ test('takeWhile', () {
+ stream.takeWhile((_) => false).listen((_) {});
+ });
+
+ test('skip', () {
+ stream.skip(0).listen((_) {});
+ });
+
+ test('skipWhile', () {
+ stream.skipWhile((_) => false).listen((_) {});
+ });
+
+ test('distinct', () {
+ stream.distinct((a, b) => false).listen((_) {});
+ });
+
+ test('first', () {
+ stream.first.then((_) {});
+ });
+
+ test('last', () {
+ stream.last.then((_) {});
+ });
+
+ test('single', () {
+ stream.single.then((_) {});
+ });
+
+ test('firstMatching', () {
+ stream.firstMatching((_) => true).then((_) {});
+ });
+
+ test('lastMatching', () {
+ stream.lastMatching((_) => true).then((_) {});
+ });
+
+ test('singleMatching', () {
+ stream.singleMatching((_) => true).then((_) {});
+ });
+
+ test('elementAt', () {
+ stream.elementAt(0).then((_) {});
+ });
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698