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

Side by Side Diff: tests/language_strong/generic_methods_optional_parameters_test.dart

Issue 2737933002: Add tests for generic methods in strong mode (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, 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 generic_methods_optional_parameters_test;
6
7 import "package:expect/expect.dart";
8
9 typedef FunObjObj = Object Function<T>(Object, [Object]);
10 typedef FunTypObj = Object Function<T>(T, [Object]);
11 typedef FunObjTyp = Object Function<T>(Object, [T]);
12 typedef FunTypTyp = Object Function<T>(T, [T]);
13
14 Object funObjObj<T>(Object x, [Object y]) => x;
15 Object funTypObj<T>(T x, [Object y]) => y;
16 Object funObjTyp<T>(Object x, [T y]) => x;
17 Object funTypTyp<T>(T x, [T y]) => null;
18
19 main() {
20 Expect.isTrue(funObjObj is FunObjObj);
Leaf 2017/03/09 05:51:19 As in the previous test, maybe check funObjObj aga
Dmitry Stefantsov 2017/03/10 13:21:54 Done.
21
22 Expect.isTrue(funTypObj is FunTypObj);
23 Expect.isTrue(funTypObj is! FunObjObj);
eernst 2017/03/09 14:55:02 Same comment as in the previous test from me, too.
Dmitry Stefantsov 2017/03/10 13:21:54 Agree here as well :) Done.
24
25 Expect.isTrue(funObjTyp is FunObjTyp);
26 Expect.isTrue(funObjTyp is! FunObjObj);
27
28 Expect.isTrue(funTypTyp is FunTypTyp);
29 Expect.isTrue(funTypTyp is! FunTypObj);
30 Expect.isTrue(funTypTyp is! FunObjTyp);
31 Expect.isTrue(funTypTyp is! FunObjObj);
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698