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

Side by Side Diff: tests/lib/mirrors/local_function_is_static_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.local_function_is_static; 5 library test.local_function_is_static;
6 6
7 @MirrorsUsed(targets: "test.local_function_is_static")
7 import 'dart:mirrors'; 8 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
9 10
10 topLevel() => 1; 11 topLevel() => 1;
11 topLevelLocal() => () => 2; 12 topLevelLocal() => () => 2;
12 class C { 13 class C {
13 static klass() => 3; 14 static klass() => 3;
14 static klassLocal() => () => 4; 15 static klassLocal() => () => 4;
15 instance() => 5; 16 instance() => 5;
16 instanceLocal() => () => 6; 17 instanceLocal() => () => 6;
(...skipping 17 matching lines...) Expand all
34 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic); 35 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic);
35 36
36 f = new C().instance; 37 f = new C().instance;
37 Expect.equals(5, f()); 38 Expect.equals(5, f());
38 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); 39 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic);
39 40
40 f = new C().instanceLocal(); 41 f = new C().instanceLocal();
41 Expect.equals(6, f()); 42 Expect.equals(6, f());
42 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); 43 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic);
43 } 44 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/list_constructor_test.dart ('k') | tests/lib/mirrors/metadata_class_mirror_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698