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

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

Issue 24631003: Add proper API for creating private symbols wrt a library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: maintain dart2js coverage Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/intercepted_object_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'dart:mirrors'; 5 import 'dart:mirrors';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'stringify.dart'; 7 import 'stringify.dart';
8 8
9 testIntercepted() { 9 testIntercepted() {
10 var instance = []; 10 var instance = [];
11 var methodMirror = reflect(instance.toString); 11 var closureMirror = reflect(instance.toString);
12 String rest = ' in s(List)'; 12 var methodMirror = closureMirror.function;
13 rest = ''; /// 01: ok 13 Expect.equals(#toString, methodMirror.simpleName);
14 expect('Method(s(toString)$rest)', methodMirror.function); 14 Expect.equals('[]', closureMirror.apply([]).reflectee);
15 Expect.equals('[]', methodMirror.apply([]).reflectee);
16 } 15 }
17 16
18 testNonIntercepted() { 17 testNonIntercepted() {
19 var closure = new Map().containsKey; 18 var closure = new Map().containsKey;
20 var mirror = reflect(closure); 19 var closureMirror = reflect(closure);
21 String rest = ' in s(_HashMap)'; // Might become Map instead. 20 var methodMirror = closureMirror.function;
22 rest = ''; /// 01: ok 21 Expect.equals(#containsKey, methodMirror.simpleName);
23 expect('Method(s(containsKey)$rest)', mirror.function); 22 Expect.isFalse(closureMirror.apply([7]).reflectee);
24 Expect.isFalse(mirror.apply([7]).reflectee);
25 } 23 }
26 24
27 main() { 25 main() {
28 testIntercepted(); 26 testIntercepted();
29 testNonIntercepted(); 27 testNonIntercepted();
30 } 28 }
OLDNEW
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/intercepted_object_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698