blob: 56df6ac12f7144fd29f339429d2d7bb07f2015e7 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
import "dart:mirrors" as mir;
import "dart:mirrors";
class _FailingTest extends core::Object {
const constructor •() self::_FailingTest
: super core::Object::•()
;
}
class MyTest extends core::Object {
synthetic constructor •() self::MyTest
: super core::Object::•()
;
@self::failingTest
method foo() void {}
}
abstract class _MyTest2&Object&MyTest = core::Object with self::MyTest {
const synthetic constructor •() self::_MyTest2&Object&MyTest
: super core::Object::•()
;
}
class MyTest2 extends self::_MyTest2&Object&MyTest {
synthetic constructor •() self::MyTest2
: super self::_MyTest2&Object&MyTest::•()
;
}
static const field self::_FailingTest failingTest = const self::_FailingTest::•();
static method main() dynamic {
mir::ClassMirror classMirror = mir::reflectClass(self::MyTest2);
classMirror.instanceMembers.forEach((core::Symbol symbol, mir::MethodMirror memberMirror) dynamic {
if(memberMirror.simpleName.==(#foo)) {
core::print(memberMirror);
core::print(self::_hasFailingTestAnnotation(memberMirror));
}
});
}
static method _hasFailingTestAnnotation(mir::MethodMirror method) core::bool {
dynamic r = self::_hasAnnotationInstance(method, self::failingTest);
core::print("[_hasFailingTestAnnotation] ${method} ${r}");
return r;
}
static method _hasAnnotationInstance(mir::DeclarationMirror declaration, dynamic instance) core::bool
return declaration.metadata.any((mir::InstanceMirror annotation) dynamic {
core::print("annotation: ${annotation.reflectee}");
return core::identical(annotation.reflectee, instance);
});