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

Side by Side Diff: tests/lib/mirrors/metadata_scope_test.dart

Issue 2727323002: Add @MirrorsUsed annotations to speed up tests. (Closed)
Patch Set: Minor fixes. Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 test.metadata_scope; 5 library test.metadata_scope;
6 6
7 @MirrorsUsed(targets: "test.metadata_scope")
7 import 'dart:mirrors'; 8 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
9 10
10 class Annotation { 11 class Annotation {
11 final contents; 12 final contents;
12 const Annotation(this.contents); 13 const Annotation(this.contents);
13 toString() => "Annotation($contents)"; 14 toString() => "Annotation($contents)";
14 } 15 }
15 16
16 // Note there is no compile-time constant 'foo' in scope. In particular, A.foo 17 // Note there is no compile-time constant 'foo' in scope. In particular, A.foo
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 checkMetadata(reflectClass(B), [const Annotation(B.foo)]); 55 checkMetadata(reflectClass(B), [const Annotation(B.foo)]);
55 checkMetadata(reflectClass(B).declarations[#T], [const Annotation(B.foo)]); 56 checkMetadata(reflectClass(B).declarations[#T], [const Annotation(B.foo)]);
56 checkMetadata(reflectClass(B).declarations[#foo], [const Annotation(B.foo)]); 57 checkMetadata(reflectClass(B).declarations[#foo], [const Annotation(B.foo)]);
57 checkMetadata(reflectClass(B).declarations[#bar], [const Annotation(B.foo)]); 58 checkMetadata(reflectClass(B).declarations[#bar], [const Annotation(B.foo)]);
58 // The top-level function baz, not C.baz. 59 // The top-level function baz, not C.baz.
59 checkMetadata(reflectClass(C), [const Annotation(baz)]); 60 checkMetadata(reflectClass(C), [const Annotation(baz)]);
60 // C.baz, not the top-level function baz. 61 // C.baz, not the top-level function baz.
61 checkMetadata(reflectClass(C).declarations[#T], [const Annotation(C.baz)]); 62 checkMetadata(reflectClass(C).declarations[#T], [const Annotation(C.baz)]);
62 checkMetadata(reflectClass(C).declarations[#baz], [const Annotation(C.baz)]); 63 checkMetadata(reflectClass(C).declarations[#baz], [const Annotation(C.baz)]);
63 } 64 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/metadata_nested_constructor_call_test.dart ('k') | tests/lib/mirrors/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698