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

Side by Side Diff: utils/tests/peg/peg_test.dart

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
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 peg_tests; 5 library peg_tests;
6 import '../../peg/pegparser.dart'; 6 import '../../peg/pegparser.dart';
7 7
8 testParens() { 8 testParens() {
9 Grammar g = new Grammar(); 9 Grammar g = new Grammar();
10 Symbol a = g['A']; 10 Symbol a = g['A'];
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (expected is String) 315 if (expected is String)
316 formatted = printList(ast); 316 formatted = printList(ast);
317 317
318 Expect.equals(expected, formatted, "parse: $input"); 318 Expect.equals(expected, formatted, "parse: $input");
319 } 319 }
320 320
321 // Prints the list in [1,2,3] notation, including nested lists. 321 // Prints the list in [1,2,3] notation, including nested lists.
322 printList(item) { 322 printList(item) {
323 if (item is List) { 323 if (item is List) {
324 StringBuffer sb = new StringBuffer(); 324 StringBuffer sb = new StringBuffer();
325 sb.add('['); 325 sb.write('[');
326 var sep = ''; 326 var sep = '';
327 for (var x in item) { 327 for (var x in item) {
328 sb.add(sep); 328 sb.write(sep);
329 sb.add(printList(x)); 329 sb.write(printList(x));
330 sep = ','; 330 sep = ',';
331 } 331 }
332 sb.add(']'); 332 sb.write(']');
333 return sb.toString(); 333 return sb.toString();
334 } 334 }
335 if (item == null) 335 if (item == null)
336 return 'null'; 336 return 'null';
337 return item.toString(); 337 return item.toString();
338 } 338 }
339 339
340 main() { 340 main() {
341 testCODE(); 341 testCODE();
342 testParens(); 342 testParens();
343 testOR(); 343 testOR();
344 testTEXT(); 344 testTEXT();
345 testBlockComment(); 345 testBlockComment();
346 testC(); 346 testC();
347 } 347 }
OLDNEW
« utils/template/tree.dart ('K') | « utils/testrunner/layout_test_controller.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698