diff --git a/tests/lib/lib.status b/tests/lib/lib.status index 923014f848e..4a89f010dc3 100644 --- a/tests/lib/lib.status +++ b/tests/lib/lib.status @@ -73,7 +73,7 @@ mirrors/method_mirror_location_test: RuntimeError # Issue 6490 mirrors/mirrors_test: RuntimeError # TODO(ahe): I'm working on fixing this. When removing this line please change the "endsWith" to "/mirrors_test.dart". mirrors/mirrors_nsm_test/dart2js: RuntimeError # Issue 19353 mirrors/mixin_test: RuntimeError # Issue 12464 -mirrors/mixin_application_test/none: RuntimeError # Issue 12464 +mirrors/mixin_application_test: RuntimeError # Issue 12464 mirrors/parameter_test/none: RuntimeError # Issue 6490 mirrors/parameter_of_mixin_app_constructor_test: RuntimeError # Issue 6490 mirrors/private_symbol_test: CompileTimeError # Issue 13597 @@ -89,7 +89,7 @@ mirrors/relation_subtype_test: RuntimeError # Issue 6490 mirrors/repeated_private_anon_mixin_app_test: RuntimeError # Issue 14670 mirrors/symbol_validation_test/01: RuntimeError # Issue 13597 mirrors/static_members_test: RuntimeError # Issue 14633, Issue 12164 -mirrors/typedef_test/none: RuntimeError # http://dartbug.com/6490 +mirrors/typedef_test: RuntimeError # http://dartbug.com/6490 mirrors/typedef_metadata_test: RuntimeError # Issue 12785 mirrors/typedef_reflected_type_test/01: RuntimeError # Issue 12607 mirrors/typevariable_mirror_metadata_test: CompileTimeError # Issue 10905 @@ -225,19 +225,13 @@ async/timer_test: Fail, Pass async/timer_not_available_test: Fail, OK mirrors/native_class_test: Fail, OK # This test is meant to run in a browser. -[ $compiler == none ] -mirrors/hierarchy_test: Fail # TODO(ahe): This test is slightly broken. http://dartbug.com/12464 -mirrors/mixin_application_test/01: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js. -mirrors/intercepted_object_test: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js. -mirrors/typedef_test/01: Fail, OK # Incorrect dart2js behavior. +[ $compiler == none ] +async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8) mirrors/generic_local_function_test: RuntimeError # Issue 14913 mirrors/symbol_validation_test: RuntimeError # Issue 13596 -mirrors/mirrors_used_inheritance_test: RuntimeError # Issue 16048 -async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8) - -mirrors/typedef_declaration_test/01: Fail # dartbug.com/16048. Remove multitest marker when it passes. +mirrors/mirrors_used*: Skip # Invalid tests. [ $compiler == none && ( $runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ] async/schedule_microtask6_test: Fail # Issue 10910 diff --git a/tests/lib/mirrors/hierarchy_test.dart b/tests/lib/mirrors/hierarchy_test.dart deleted file mode 100644 index 16937a6d6aa..00000000000 --- a/tests/lib/mirrors/hierarchy_test.dart +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library hierarchy_test; - -@MirrorsUsed(targets: 'hierarchy_test, Object') -import 'dart:mirrors'; - -import 'package:expect/expect.dart'; - -class FooMixin { - foo() => print('foo'); -} - -class Qux { - qux() => print('qux'); -} - -class Bar extends Qux implements FooMixin { - bar() => print('bar'); - foo() => print('foo'); -} - -class Baz extends Qux with FooMixin { - bar() => print('bar'); -} - -stringifyHierarchy(mirror) { - var sb = new StringBuffer(); - for (var type = mirror.type; type != null; type = type.superclass) { - sb.write('> ${MirrorSystem.getName(type.qualifiedName)}\n'); - for (var i in type.superinterfaces) { - sb.write(' + ${MirrorSystem.getName(i.qualifiedName)}\n'); - } - } - return '$sb'; -} - -main() { - Expect.stringEquals(''' -> hierarchy_test.Bar - + hierarchy_test.FooMixin -> hierarchy_test.Qux -> dart.core.Object -''', stringifyHierarchy(reflect(new Bar()..foo()..bar()..qux()))); - - Expect.stringEquals(''' -> hierarchy_test.Baz -> hierarchy_test.Qux with hierarchy_test.FooMixin - + hierarchy_test.FooMixin -> hierarchy_test.Qux -> dart.core.Object -''', stringifyHierarchy(reflect(new Baz()..foo()..bar()..qux()))); -} diff --git a/tests/lib/mirrors/intercepted_object_test.dart b/tests/lib/mirrors/intercepted_object_test.dart index 1aa80608542..e01733b114c 100644 --- a/tests/lib/mirrors/intercepted_object_test.dart +++ b/tests/lib/mirrors/intercepted_object_test.dart @@ -25,6 +25,12 @@ checkImplements(object, String name) { return; } } + + // A class implements itself, even if not explicitly declared. + if (symName == stringify(cls.simpleName)) { + checkClassMirrorMethods(cls); + return; + } // TODO(floitsch): use correct fail expect(name, "super interface not found"); diff --git a/tests/lib/mirrors/typedef_declaration_test.dart b/tests/lib/mirrors/mirrors_used_typedef_declaration_test.dart similarity index 100% rename from tests/lib/mirrors/typedef_declaration_test.dart rename to tests/lib/mirrors/mirrors_used_typedef_declaration_test.dart diff --git a/tests/lib/mirrors/mixin_application_test.dart b/tests/lib/mirrors/mixin_application_test.dart index 10b7866c8a5..346d9d53e43 100644 --- a/tests/lib/mirrors/mixin_application_test.dart +++ b/tests/lib/mirrors/mixin_application_test.dart @@ -118,7 +118,6 @@ testMixinApplication() { ]); String owner = 'Mixin'; - owner = 'MixinApplication'; /// 01: ok expect( '{i: Variable(s(i) in s($owner)),' ' m: Method(s(m) in s($owner))}', @@ -132,9 +131,7 @@ testMixinApplication() { } testMixinApplicationA() { - // TODO(ahe): I don't think an anonymous mixin has an owner. String owner = ' in s(test.mixin_application_test)'; - owner = ''; /// 01: ok checkClass(MixinApplicationA, [ 'Class(s(MixinApplicationA)' ' in s(test.mixin_application_test), top-level)', @@ -147,7 +144,6 @@ testMixinApplicationA() { ]); owner = 'Mixin2'; - owner = 'MixinApplicationA'; /// 01: ok expect( '{i2: Variable(s(i2) in s($owner)),' ' m2: Method(s(m2) in s($owner))}', @@ -164,7 +160,6 @@ testMixinApplicationA() { membersOf(reflectClass(MixinApplicationA).superclass)); String name = 'test.model.C with test.mixin_application_test.Mixin'; - name = 'Mixin'; /// 01: ok expect( '{$name:' ' Method(s($name)' @@ -187,7 +182,6 @@ testUnusedMixinApplication() { ]); String owner = 'Mixin'; - owner = 'UnusedMixinApplication'; /// 01: ok expect( '{i: Variable(s(i) in s($owner)),' ' m: Method(s(m) in s($owner))}', @@ -203,7 +197,6 @@ testUnusedMixinApplication() { testSubclass() { String owner = ' in s(test.mixin_application_test)'; - owner = ''; /// 01: ok checkClass(Subclass, [ 'Class(s(Subclass) in s(test.mixin_application_test), top-level)', 'Class(s(test.model.C with test.mixin_application_test.Mixin)' @@ -228,7 +221,6 @@ testSubclass() { membersOf(reflectClass(Subclass).superclass)); String name = 'test.model.C with test.mixin_application_test.Mixin'; - name = 'Mixin'; /// 01: ok expect( '{$name:' ' Method(s($name)' @@ -264,9 +256,7 @@ testSubclass2() { } testSubclassA() { - // TODO(ahe): I don't think an anonymous mixin has an owner. String owner = ' in s(test.mixin_application_test)'; - owner = ''; /// 01: ok checkClass(SubclassA, [ 'Class(s(SubclassA) in s(test.mixin_application_test), top-level)', 'Class(s(test.model.C with test.mixin_application_test.Mixin,' @@ -295,7 +285,6 @@ testSubclassA() { String name = 'test.model.C with test.mixin_application_test.Mixin,' ' test.mixin_application_test.Mixin2'; - name = 'Mixin2'; /// 01: ok expect( '{$name: Method(s($name) in s($name), constructor)}', constructorsOf(reflectClass(SubclassA).superclass)); @@ -306,7 +295,6 @@ testSubclassA() { membersOf(reflectClass(SubclassA).superclass.superclass)); name = 'test.model.C with test.mixin_application_test.Mixin'; - name = 'Mixin'; /// 01: ok expect( '{$name:' ' Method(s($name)' @@ -319,9 +307,7 @@ testSubclassA() { } testSubclass2A() { - // TODO(ahe): I don't think an anonymous mixin has an owner. String owner = ' in s(test.mixin_application_test)'; - owner = ''; /// 01: ok checkClass(Subclass2A, [ 'Class(s(Subclass2A) in s(test.mixin_application_test), top-level)', 'Class(s(MixinApplicationA) in s(test.mixin_application_test),' diff --git a/tests/lib/mirrors/typedef_test.dart b/tests/lib/mirrors/typedef_test.dart index 11b9e713e4e..19c7a70f771 100644 --- a/tests/lib/mirrors/typedef_test.dart +++ b/tests/lib/mirrors/typedef_test.dart @@ -43,19 +43,13 @@ check(t) { // Return "$args -> $ret". ft(args, ret) { - return '$args -> $ret' - // TODO(ahe): dart2js doesn't fully qualify type names. - .replaceAll('dart.core.', '') /// 01: ok - ; + return '$args -> $ret'; } void main() { String x = 'x'; String y = 'y'; String z = 'z'; - x = 'argument0'; /// 01: ok - y = 'argument1'; /// 01: ok - z = 'argument2'; /// 01: ok Expect.stringEquals( """