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

Unified Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 155703004: Support parameter metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index d7b02c7ce1c96c056588880fc3a74f9ec2eca01d..13cffcc13a345839155011920a9d71d9a7220242 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -153,7 +153,15 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
var fooClassMembers = fooClass.declarations;
Expect.isNotNull(fooClassMembers, "Declared members map is null");
- Expect.isTrue(fooClassMembers.isEmpty, "Declared members map is unempty");
+ Expect.equals(1, fooClassMembers.length);
+
+ var fooM = fooClassMembers[#m];
+ Expect.isNotNull(fooM);
+ Expect.isTrue(fooM is MethodMirror);
+ Expect.equals(1, fooM.parameters.length);
+ var fooMa = fooM.parameters[0];
+ Expect.isNotNull(fooMa);
+ Expect.isTrue(fooMa is ParameterMirror);
//////////////////////////////////////////////////////////////////////////////
// Metadata tests
@@ -337,7 +345,7 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNull(mapData.getValue('bar'));
// @metadata
- metadata = metadataList[metadataListIndex++];
+ var metadataRef = metadata = metadataList[metadataListIndex++];
Expect.isTrue(metadata is InstanceMirror);
Expect.isFalse(metadata.hasReflectee);
Expect.throws(() => metadata.reflectee, (_) => true);
@@ -375,6 +383,10 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.equals(metadataList.length, metadataListIndex);
+ Expect.isNotNull(fooMa.metadata);
+ Expect.equals(1, fooMa.metadata.length);
+ Expect.equals(metadataRef, fooMa.metadata[0]);
+
//////////////////////////////////////////////////////////////////////////////
// Location test
//////////////////////////////////////////////////////////////////////////////
@@ -385,7 +397,7 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
// leading comment.
Expect.equals(376, fooClassLocation.offset, "Unexpected offset");
// Expect the location to end with the class body.
- Expect.equals(332, fooClassLocation.length, "Unexpected length");
+ Expect.equals(351, fooClassLocation.length, "Unexpected length");
Expect.equals(18, fooClassLocation.line, "Unexpected line");
Expect.equals(1, fooClassLocation.column, "Unexpected column");

Powered by Google App Engine
This is Rietveld 408576698