Chromium Code Reviews| Index: tests/language/reflect_core_vm_test.dart |
| =================================================================== |
| --- tests/language/reflect_core_vm_test.dart (revision 0) |
| +++ tests/language/reflect_core_vm_test.dart (revision 0) |
| @@ -0,0 +1,20 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// Test reflection of private functions in core classes. |
| + |
| +import "package:expect/expect.dart"; |
| +import "dart:mirrors"; |
| + |
| +main() { |
| + var s = "string"; |
| + var im = reflect(s); |
| + try { |
| + im.invoke(const Symbol("_setAt"), [0, 65]); |
| + Expect.isTrue(false); // Unreachable. |
|
srdjan
2013/08/23 13:58:18
Expect.throws(() =>im.invoke(const Symbol("_setAt"
|
| + } catch (e) { |
| + Expect.equals(true, e is NoSuchMethodError); |
| + } |
| +} |
| + |