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

Side by Side Diff: pkg/kernel/testcases/closures/uncaptured_for_in_loop.dart.expect

Issue 2935223003: Update expectations for closure conversion tests (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/kernel/testcases/closures/type_variables.dart.expect ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library; 1 library;
2 import self as self; 2 import self as self;
3 import "dart:core" as core; 3 import "dart:core" as core;
4 4
5 static const field dynamic numbers = const <core::int>[0, 1, 2, 3, 4, 5, 6, 7, 8 , 9]; 5 static const field dynamic numbers = const <core::int>[0, 1, 2, 3, 4, 5, 6, 7, 8 , 9];
6 static method main() → dynamic { 6 static method main() → dynamic {
7 dynamic closures = <dynamic>[]; 7 dynamic closures = <dynamic>[];
8 for (core::int i in self::numbers) { 8 for (core::int i in self::numbers) {
9 final Vector #context = MakeVector(2); 9 final Vector #context = MakeVector(2);
10 #context[1] = i; 10 #context[1] = i;
11 closures.add(MakeClosure<() → dynamic>(self::closure#main#function, #context )); 11 closures.add(MakeClosure<() → core::int>(self::closure#main#function, #conte xt));
12 } 12 }
13 core::int sum = 0; 13 core::int sum = 0;
14 for (core::Function f in closures) { 14 for (core::Function f in closures) {
15 sum = sum.+(f.call()); 15 sum = sum.+(f.call());
16 } 16 }
17 core::int expectedSum = self::numbers.length.-(1).*(self::numbers.length).~/(2 ); 17 core::int expectedSum = self::numbers.length.-(1).*(self::numbers.length).~/(2 );
18 if(!expectedSum.==(sum)) { 18 if(!expectedSum.==(sum)) {
19 throw core::Exception::•("Unexpected sum = ${sum} != ${expectedSum}"); 19 throw core::Exception::•("Unexpected sum = ${sum} != ${expectedSum}");
20 } 20 }
21 } 21 }
22 static method closure#main#function(Vector #contextParameter) → dynamic { 22 static method closure#main#function(Vector #contextParameter) → core::int {
23 return #contextParameter[1]; 23 return #contextParameter[1];
24 } 24 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/closures/type_variables.dart.expect ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698