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

Unified Diff: tests/lib/mirrors/toplevel_members_test.dart

Issue 44813004: Tests for instanceMembers, staticMembers, toplevelMembers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/mirrors/static_members_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/toplevel_members_test.dart
diff --git a/tests/lib/mirrors/toplevel_members_test.dart b/tests/lib/mirrors/toplevel_members_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f79bfc05487bed3da2ec8533eea4d2280a19cd75
--- /dev/null
+++ b/tests/lib/mirrors/toplevel_members_test.dart
@@ -0,0 +1,52 @@
+// 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.
+
+library test.toplevel_members;
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+import 'stringify.dart';
+import 'declarations_model.dart' as declarations_model;
+
+selectKeys(map, predicate) {
+ return map.keys.where((key) => predicate(map[key]));
+}
+
+main() {
+ LibraryMirror lm =
+ currentMirrorSystem().findLibrary(#test.declarations_model);
+
+ Expect.setEquals(
+ [#libraryVariable,
+ const Symbol('libraryVariable='),
+ #libraryGetter,
+ const Symbol('librarySetter='),
+ #libraryMethod,
+ #_libraryVariable,
+ const Symbol('_libraryVariable='),
+ #_libraryGetter,
+ const Symbol('_librarySetter='),
+ #_libraryMethod,
+ #Predicate,
+ #Superclass,
+ #Interface,
+ #Mixin,
+ #_PrivateClass,
+ #ConcreteClass],
+ selectKeys(lm.topLevelMembers, (dm) => true));
+
+ Expect.setEquals(
+ [#libraryVariable,
+ const Symbol('libraryVariable='),
+ #_libraryVariable,
+ const Symbol('_libraryVariable='),
+ #Predicate,
+ #Superclass,
+ #Interface,
+ #Mixin,
+ #_PrivateClass,
+ #ConcreteClass],
+ selectKeys(lm.topLevelMembers, (dm) => dm.isSynthetic));
+}
« no previous file with comments | « tests/lib/mirrors/static_members_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698