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

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

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library stream_controller_async_test;
6
7 import "package:expect/expect.dart";
8 import 'dart:async';
9 import 'dart:isolate';
10 import '../../../pkg/unittest/lib/unittest.dart';
11 import 'event_helper.dart';
12 import 'stream_state_helper.dart';
13
14 class A { const A(); }
15 class B extends A { const B(); }
16
17 main() {
18 Events sentEvents = new Events()..close();
19
20 // Make sure that firstWhere allows to return instances of types that are
21 // different than the generic type of the stream.
22 test("firstWhere with super class", () {
23 StreamController c = new StreamController<B>();
24 Future f = c.stream.firstWhere((x) => false, defaultValue: () => const A());
25 f.then(expectAsync1((v) { Expect.equals(const A(), v); }));
26 sentEvents.replay(c);
27 });
28 }
OLDNEW
« no previous file with comments | « tests/html/custom_element_bindings_test.dart ('k') | tests/lib/async/stream_last_where_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698