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

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

Issue 22638011: Move Null class out of the VM isolate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | 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 library test.null_test; 5 library test.null_test;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
11 main() { 11 main() {
12 InstanceMirror nullMirror = reflect(null); 12 InstanceMirror nullMirror = reflect(null);
13 Expect.isTrue(nullMirror.getField(const Symbol('hashCode')).reflectee is int); 13 Expect.isTrue(nullMirror.getField(const Symbol('hashCode')).reflectee is int);
14 Expect.equals(null.hashCode,
15 nullMirror.getField(const Symbol('hashCode')).reflectee);
14 Expect.equals('Null', 16 Expect.equals('Null',
15 nullMirror.getField(const Symbol('runtimeType')).reflectee 17 nullMirror.getField(const Symbol('runtimeType')).reflectee
16 .toString()); 18 .toString());
17 Expect.isTrue(nullMirror.invoke(const Symbol('=='), [null]).reflectee); 19 Expect.isTrue(nullMirror.invoke(const Symbol('=='), [null]).reflectee);
18 Expect.isFalse(nullMirror.invoke(const Symbol('=='), [new Object()]) 20 Expect.isFalse(nullMirror.invoke(const Symbol('=='), [new Object()])
19 .reflectee); 21 .reflectee);
20 Expect.equals('null', 22 Expect.equals('null',
21 nullMirror.invoke(const Symbol('toString'), []).reflectee); 23 nullMirror.invoke(const Symbol('toString'), []).reflectee);
22 Expect.throws(() => nullMirror.invoke(const Symbol('notDefined'), []), 24 Expect.throws(() => nullMirror.invoke(const Symbol('notDefined'), []),
23 (e) => e is NoSuchMethodError, 25 (e) => e is NoSuchMethodError,
24 'noSuchMethod'); 26 'noSuchMethod');
25 27
26 ClassMirror NullMirror = nullMirror.type; 28 ClassMirror NullMirror = nullMirror.type;
27 Expect.equals(const Symbol('Null'), NullMirror.simpleName); 29 Expect.equals(const Symbol('Null'), NullMirror.simpleName);
28 Expect.equals(const Symbol('Object'), NullMirror.superclass.simpleName); 30 Expect.equals(const Symbol('Object'), NullMirror.superclass.simpleName);
29 Expect.equals(null, NullMirror.superclass.superclass); 31 Expect.equals(null, NullMirror.superclass.superclass);
30 Expect.equals(null, NullMirror.owner); // Null belongs to no library. 32 Expect.listEquals([], NullMirror.superinterfaces);
33 Expect.equals(currentMirrorSystem().libraries[Uri.parse('dart:core')],
34 NullMirror.owner);
31 } 35 }
OLDNEW
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698