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)]); |
} |