Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 // TODO(rmacnak): Move the existing mirror tests here (a place for | |
|
ahe
2013/04/17 10:47:32
?
Johnni Winther
2013/04/22 09:27:18
Removed.
| |
| 6 // cross-implementation tests). | |
| 7 | |
| 8 library MirrorsTest; | |
|
ahe
2013/04/17 10:47:32
Add a line?
Johnni Winther
2013/04/22 09:27:18
Done.
| |
| 9 import "dart:mirrors"; | |
| 10 import "../../../pkg/unittest/lib/unittest.dart"; | |
| 11 import 'dart:uri'; | |
| 12 import 'package:args/args.dart'; | |
|
ahe
2013/04/17 10:47:32
Quotes and order.
Johnni Winther
2013/04/22 09:27:18
Done.
| |
| 13 | |
| 14 testLibraryUri(var value, Uri expectedUri) { | |
| 15 var valueMirror = reflect(value); | |
| 16 ClassMirror valueClass = valueMirror.type; | |
| 17 LibraryMirror valueLibrary = valueClass.owner; | |
| 18 expect(valueLibrary.uri, equals(expectedUri)); | |
| 19 } | |
| 20 | |
| 21 main() { | |
| 22 var mirrors = currentMirrorSystem(); | |
| 23 test("Test package library uri", () { | |
| 24 testLibraryUri(new ArgParser(), Uri.parse('package:args/args.dart')); | |
| 25 }); | |
| 26 } | |
| OLD | NEW |