mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:01:19 +00:00
[tests] Minor fixes in control flow collections for tests
Change-Id: I61bbe247b8474a6eeb2d63f9acbd99218f2d04e6 Reviewed-on: https://dart-review.googlesource.com/c/94140 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
f0155931a9
commit
646c1f679a
|
@ -178,7 +178,7 @@ void testSet() {
|
|||
// Does not flatten nested collection literal.
|
||||
Expect.listEquals([1], {for (var i = 1; i < 2; i++) [i]}.first);
|
||||
Expect.mapEquals({1: 1}, {for (var i = 1; i < 2; i++) {i: i}}.first);
|
||||
Expect.setEquals({1}, }for (var i = 1; i < 2; i++) {i}}.first);
|
||||
Expect.setEquals({1}, {for (var i = 1; i < 2; i++) {i}}.first);
|
||||
|
||||
// Downcast variable.
|
||||
Expect.setEquals(set, <int>{for (int n in <num>[1, 2, 3, 4]) n});
|
||||
|
@ -196,13 +196,15 @@ void testDuplicateKeys() {
|
|||
1: 1,
|
||||
for (var i in <int>[1, 2, 3]) i: i,
|
||||
for (var i = 2; i <= 3; i++) i: i,
|
||||
3: 3
|
||||
3: 3,
|
||||
4: 4
|
||||
});
|
||||
Expect.setEquals(set, <int>{
|
||||
1,
|
||||
for (var i in <int>[1, 2, 3]) i,
|
||||
for (var i = 2; i <= 3; i++) i,
|
||||
3
|
||||
3,
|
||||
4
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue