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

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

Issue 2850783002: Dart SDK Spelling b, c, and d. (Closed)
Patch Set: Created 3 years, 7 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; 5 library test;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 8
9 @MirrorsUsed(targets: "Foo") 9 @MirrorsUsed(targets: "Foo")
10 import 'dart:mirrors'; 10 import 'dart:mirrors';
11 11
12 typedef int Foo(String x); 12 typedef int Foo(String x);
13 typedef int Bar(); 13 typedef int Bar();
14 14
15 main() { 15 main() {
16 LibraryMirror thisLibrary = currentMirrorSystem().findLibrary(#test); 16 LibraryMirror thisLibrary = currentMirrorSystem().findLibrary(#test);
17 17
18 Mirror fooMirror = thisLibrary.declarations[#Foo]; 18 Mirror fooMirror = thisLibrary.declarations[#Foo];
19 19
20 Expect.isTrue(fooMirror != null, 'Foo not found.'); 20 Expect.isTrue(fooMirror != null, 'Foo not found.');
21 Expect.isTrue(thisLibrary.declarations[#Foo] is TypedefMirror, 21 Expect.isTrue(thisLibrary.declarations[#Foo] is TypedefMirror,
22 'TypedefMirror expected, found $fooMirror'); 22 'TypedefMirror expected, found $fooMirror');
23 23
24 // The following code does not currenty work on the VM, because it does not 24 // The following code does not currently work on the VM, because it does not
25 // support MirrorsUsed (see dartbug.com/16048). 25 // support MirrorsUsed (see dartbug.com/16048).
26 Mirror barMirror = thisLibrary.declarations[#Bar]; // //# 01: ok 26 Mirror barMirror = thisLibrary.declarations[#Bar]; // //# 01: ok
27 Expect.isTrue(barMirror == null, // //# 01: cont inued 27 Expect.isTrue(barMirror == null, // //# 01: cont inued
28 'Bar should not be emitted due to MirrorsUsed.'); //# 01: contin ued 28 'Bar should not be emitted due to MirrorsUsed.'); //# 01: contin ued
29 } 29 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/mirrors_reader.dart ('k') | tests/lib_strong/async/intercept_schedule_microtask2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698