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

Side by Side Diff: tests/html/utils.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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
« no previous file with comments | « tests/html/localstorage_test.dart ('k') | tests/language/compile_time_constant_a_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('TestUtils'); 1 #library('TestUtils');
2 2
3 /** 3 /**
4 * Verifies that [actual] has the same graph structure as [expected]. 4 * Verifies that [actual] has the same graph structure as [expected].
5 * Detects cycles and DAG structure in Maps and Lists. 5 * Detects cycles and DAG structure in Maps and Lists.
6 */ 6 */
7 verifyGraph(expected, actual) { 7 verifyGraph(expected, actual) {
8 var eItems = []; 8 var eItems = [];
9 var aItems = []; 9 var aItems = [];
10 10
(...skipping 30 matching lines...) Expand all
41 Expect.equals(expected.length, actual.length, 41 Expect.equals(expected.length, actual.length,
42 message(path, 'different list lengths')); 42 message(path, 'different list lengths'));
43 for (var i = 0; i < expected.length; i++) { 43 for (var i = 0; i < expected.length; i++) {
44 walk('$path[$i]', expected[i], actual[i]); 44 walk('$path[$i]', expected[i], actual[i]);
45 } 45 }
46 return; 46 return;
47 } 47 }
48 48
49 if (expected is Map) { 49 if (expected is Map) {
50 Expect.isTrue(actual is Map, message(path, '$actual is Map')); 50 Expect.isTrue(actual is Map, message(path, '$actual is Map'));
51 for (var key in expected.getKeys()) { 51 for (var key in expected.keys) {
52 if (!actual.containsKey(key)) { 52 if (!actual.containsKey(key)) {
53 Expect.fail(message(path, 'missing key "$key"')); 53 Expect.fail(message(path, 'missing key "$key"'));
54 } 54 }
55 walk('$path["$key"]', expected[key], actual[key]); 55 walk('$path["$key"]', expected[key], actual[key]);
56 } 56 }
57 for (var key in actual.getKeys()) { 57 for (var key in actual.keys) {
58 if (!expected.containsKey(key)) { 58 if (!expected.containsKey(key)) {
59 Expect.fail(message(path, 'extra key "$key"')); 59 Expect.fail(message(path, 'extra key "$key"'));
60 } 60 }
61 } 61 }
62 return; 62 return;
63 } 63 }
64 64
65 Expect.fail('Unhandled type: $expected'); 65 Expect.fail('Unhandled type: $expected');
66 } 66 }
67 67
68 walk('', expected, actual); 68 walk('', expected, actual);
69 } 69 }
OLDNEW
« no previous file with comments | « tests/html/localstorage_test.dart ('k') | tests/language/compile_time_constant_a_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698