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

Side by Side Diff: tests/compiler/dart2js/serialization/test_helper.dart

Issue 2070493003: Revert "Remove Registry from registerMetadataConstant" and "Serialize metadata" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | « tests/compiler/dart2js/serialization/model_test.dart ('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 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 dart2js.serialization_test_helper; 5 library dart2js.serialization_test_helper;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'package:compiler/src/common/resolution.dart'; 8 import 'package:compiler/src/common/resolution.dart';
9 import 'package:compiler/src/constants/expressions.dart'; 9 import 'package:compiler/src/constants/expressions.dart';
10 import 'package:compiler/src/dart_types.dart'; 10 import 'package:compiler/src/dart_types.dart';
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy()); 430 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy());
431 } 431 }
432 432
433 void checkSets( 433 void checkSets(
434 Iterable set1, 434 Iterable set1,
435 Iterable set2, 435 Iterable set2,
436 String messagePrefix, 436 String messagePrefix,
437 bool sameElement(a, b), 437 bool sameElement(a, b),
438 {bool failOnUnfound: true, 438 {bool failOnUnfound: true,
439 bool failOnExtra: true,
440 bool verbose: false, 439 bool verbose: false,
441 void onSameElement(a, b)}) { 440 void onSameElement(a, b)}) {
442 List<List> common = <List>[]; 441 List<List> common = <List>[];
443 List unfound = []; 442 List unfound = [];
444 Set remaining = computeSetDifference( 443 Set remaining = computeSetDifference(
445 set1, set2, common, unfound, 444 set1, set2, common, unfound,
446 sameElement: sameElement, 445 sameElement: sameElement,
447 checkElements: onSameElement); 446 checkElements: onSameElement);
448 StringBuffer sb = new StringBuffer(); 447 StringBuffer sb = new StringBuffer();
449 sb.write("$messagePrefix:"); 448 sb.write("$messagePrefix:");
450 if (verbose) { 449 if (verbose) {
451 sb.write("\n Common:\n ${common.join('\n ')}"); 450 sb.write("\n Common:\n ${common.join('\n ')}");
452 } 451 }
453 if (unfound.isNotEmpty || verbose) { 452 if (unfound.isNotEmpty || verbose) {
454 sb.write("\n Unfound:\n ${unfound.join('\n ')}"); 453 sb.write("\n Unfound:\n ${unfound.join('\n ')}");
455 } 454 }
456 if (remaining.isNotEmpty || verbose) { 455 if (remaining.isNotEmpty || verbose) {
457 sb.write("\n Extra: \n ${remaining.join('\n ')}"); 456 sb.write("\n Extra: \n ${remaining.join('\n ')}");
458 } 457 }
459 String message = sb.toString(); 458 String message = sb.toString();
460 if (unfound.isNotEmpty || remaining.isNotEmpty) { 459 if (unfound.isNotEmpty || remaining.isNotEmpty) {
461 460
462 if ((failOnUnfound && unfound.isNotEmpty) || 461 if (failOnUnfound || remaining.isNotEmpty) {
463 (failOnExtra && remaining.isNotEmpty)) {
464 Expect.fail(message); 462 Expect.fail(message);
465 } else { 463 } else {
466 print(message); 464 print(message);
467 } 465 }
468 } else if (verbose) { 466 } else if (verbose) {
469 print(message); 467 print(message);
470 } 468 }
471 } 469 }
472 470
473 String defaultToString(obj) => '$obj'; 471 String defaultToString(obj) => '$obj';
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 (mismatch.isNotEmpty && failOnMismatch) || 544 (mismatch.isNotEmpty && failOnMismatch) ||
547 remaining.isNotEmpty) { 545 remaining.isNotEmpty) {
548 Expect.fail(message); 546 Expect.fail(message);
549 } else { 547 } else {
550 print(message); 548 print(message);
551 } 549 }
552 } else if (verbose) { 550 } else if (verbose) {
553 print(message); 551 print(message);
554 } 552 }
555 } 553 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization/model_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698