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

Side by Side Diff: tools/dom/scripts/idlparser_test.dart

Issue 14103003: Remove use of Expect from test scripts and idlparser_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Run test scripts in checked mode. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/test.py » ('j') | tools/test.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 library idlparser_test; 5 library idlparser_test;
6 6
7 import '../../../utils/peg/pegparser.dart'; 7 import '../../../utils/peg/pegparser.dart';
8 8
9 part 'idlparser.dart'; 9 part 'idlparser.dart';
10 part 'idlrenderer.dart'; 10 part 'idlrenderer.dart';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 try { 88 try {
89 ast = grammar.parse(rule, input); 89 ast = grammar.parse(rule, input);
90 } catch (exception) { 90 } catch (exception) {
91 ast = exception; 91 ast = exception;
92 } 92 }
93 93
94 var formatted = ast; 94 var formatted = ast;
95 if (expected is String) 95 if (expected is String)
96 formatted = printList(ast); 96 formatted = printList(ast);
97 97
98 Expect.equals(expected, formatted, "parse: $input"); 98 if (expected != formatted) {
99 throw new StateError("parse: $input");
100 }
99 } 101 }
100 102
101 // Prints the list in [1,2,3] notation, including nested lists. 103 // Prints the list in [1,2,3] notation, including nested lists.
102 void printList(item) { 104 void printList(item) {
103 if (item is List) { 105 if (item is List) {
104 StringBuffer sb = new StringBuffer(); 106 StringBuffer sb = new StringBuffer();
105 sb.add('['); 107 sb.add('[');
106 var sep = ''; 108 var sep = '';
107 for (var x in item) { 109 for (var x in item) {
108 sb.add(sep); 110 sb.add(sep);
109 sb.add(printList(x)); 111 sb.add(printList(x));
110 sep = ','; 112 sep = ',';
111 } 113 }
112 sb.add(']'); 114 sb.add(']');
113 return sb.toString(); 115 return sb.toString();
114 } 116 }
115 if (item == null) 117 if (item == null)
116 return 'null'; 118 return 'null';
117 return item.toString(); 119 return item.toString();
118 } 120 }
OLDNEW
« no previous file with comments | « no previous file | tools/test.py » ('j') | tools/test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698