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

Unified Diff: pkg/kernel/test/class_hierarchy_self_check.dart

Issue 2549793002: Add 'self_check' runtime for running self-checking unit tests (Closed)
Patch Set: Address comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/kernel/test/class_hierarchy_test_disabled.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/test/class_hierarchy_self_check.dart
diff --git a/pkg/kernel/test/class_hierarchy_tester.dart b/pkg/kernel/test/class_hierarchy_self_check.dart
similarity index 95%
rename from pkg/kernel/test/class_hierarchy_tester.dart
rename to pkg/kernel/test/class_hierarchy_self_check.dart
index d4e04ad95f84a0d460d1a347e6ba0ee8b5e3b2ab..d4cc87b28580a0fa754521eeb110ef1c75d9b4e0 100644
--- a/pkg/kernel/test/class_hierarchy_tester.dart
+++ b/pkg/kernel/test/class_hierarchy_self_check.dart
@@ -8,6 +8,13 @@ import 'package:test/test.dart';
import 'class_hierarchy_basic.dart';
import 'dart:io';
import 'dart:math';
+import 'self_check_util.dart';
+
+main(List<String> args) {
+ runSelfCheck(args, (String filename) {
+ testClassHierarchyOnProgram(loadProgramFromBinary(filename));
+ });
+}
void testClassHierarchyOnProgram(Program program, {bool verbose: false}) {
BasicClassHierarchy basic = new BasicClassHierarchy(program);
@@ -115,12 +122,14 @@ void testClassHierarchyOnProgram(Program program, {bool verbose: false}) {
String eq = setter ? '=' : '';
return '$member$eq overrides $superMember$eq';
}
+
Set<String> expectedOverrides = new Set<String>();
basic.forEachOverridePair(classNode, (member, superMember, setter) {
expectedOverrides.add(getHash(member, superMember, setter));
});
Set<String> actualOverrides = new Set<String>();
- classHierarchy.forEachOverridePair(classNode, (member, superMember, setter) {
+ classHierarchy.forEachOverridePair(classNode,
+ (member, superMember, setter) {
actualOverrides.add(getHash(member, superMember, setter));
});
for (var actual in actualOverrides) {
@@ -142,7 +151,7 @@ void testClassHierarchyOnProgram(Program program, {bool verbose: false}) {
var random = new Random(12345);
List/*<T>*/ pickRandom/*<T>*/(List/*<T>*/ items, int n) {
- var result = /*<T>*/[];
+ var result = /*<T>*/ [];
for (int i = 0; i < n; ++i) {
result.add(items[random.nextInt(items.length)]);
}
« no previous file with comments | « no previous file | pkg/kernel/test/class_hierarchy_test_disabled.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698