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

Side by Side Diff: tests/corelib_2/iterable_to_set_test.dart

Issue 2993743002: fix corelib_2/iterable_to_set_test to reflect strong mode runtime checks (Closed)
Patch Set: Created 3 years, 4 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 main() { 7 main() {
8 List<int> list1 = <int>[1, 2, 3]; 8 List<int> list1 = <int>[1, 2, 3];
9 List<int> list2 = const <int>[4, 4]; 9 List<int> list2 = const <int>[4, 4];
10 List<String> list3 = <String>[]; 10 List<String> list3 = <String>[];
(...skipping 27 matching lines...) Expand all
38 Expect.isTrue(setCopy is Set<int>); 38 Expect.isTrue(setCopy is Set<int>);
39 Expect.isFalse(setCopy is Set<String>); 39 Expect.isFalse(setCopy is Set<String>);
40 Expect.isFalse(identical(setCopy, set1)); 40 Expect.isFalse(identical(setCopy, set1));
41 41
42 setStrCopy = set2.toSet(); 42 setStrCopy = set2.toSet();
43 Expect.setEquals(set2, setStrCopy); 43 Expect.setEquals(set2, setStrCopy);
44 Expect.isTrue(setStrCopy is Set<String>); 44 Expect.isTrue(setStrCopy is Set<String>);
45 Expect.isFalse(setStrCopy is Set<int>); 45 Expect.isFalse(setStrCopy is Set<int>);
46 Expect.isFalse(identical(setStrCopy, set2)); 46 Expect.isFalse(identical(setStrCopy, set2));
47 47
48 setCopy = set3.toSet(); 48 {
49 Expect.setEquals(set3, setCopy); 49 var setCopy = set3.toSet();
Jennifer Messerly 2017/08/04 23:33:11 the setCopy local in the outer scope has inferred
Bob Nystrom 2017/08/04 23:45:41 In other tests where we've had to split a reused v
Jennifer Messerly 2017/08/05 00:05:43 Done.
50 Expect.isTrue(setCopy is Set<String>); 50 Expect.setEquals(set3, setCopy);
51 Expect.isTrue(setCopy is Set<int>); 51 Expect.isFalse(setCopy is Set<String>);
Jennifer Messerly 2017/08/04 23:33:11 these should be false, not true.
Bob Nystrom 2017/08/04 23:45:41 Should we add an isTrue check for is Set<dynamic>?
Jennifer Messerly 2017/08/05 00:05:43 Done.
52 Expect.isFalse(identical(setCopy, set3)); 52 Expect.isFalse(setCopy is Set<int>);
53 Expect.isFalse(identical(setCopy, set3));
54 }
53 } 55 }
OLDNEW
« tests/corelib_2/corelib_2.status ('K') | « tests/corelib_2/corelib_2.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698