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

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

Issue 1510863004: Report compile-time error on disallowed metadata values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years 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/compiler/dart2js/mirrors_helper.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 7d3c48cb61ff93491c353a2ec92ece6243b3c3e6..ef815e97b1bf0b9ae19bb30374454837584dd6e1 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -169,7 +169,7 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
var metadataList = fooClass.metadata;
Expect.isNotNull(metadataList);
- Expect.equals(16, metadataList.length);
+ Expect.equals(14, metadataList.length);
var metadataListIndex = 0;
var metadata;
@@ -192,28 +192,17 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.stringEquals(
"Singleline doc comment.", metadata.trimmedText);
- // @Metadata
- metadata = metadataList[metadataListIndex++];
- Expect.isTrue(metadata is InstanceMirror);
- Expect.isFalse(metadata.hasReflectee);
- Expect.throws(() => metadata.reflectee, (_) => true);
- Expect.isTrue(metadata is TypeInstanceMirror);
- var metadataType = metadata.representedType;
- Expect.isNotNull(metadataType);
- Expect.equals(#Metadata, metadataType.simpleName);
-
- // // This is intentionally the type literal.
+ // @Metadata(null)
metadata = metadataList[metadataListIndex++];
+ var metadataType = metadata.type;
Expect.isTrue(metadata is InstanceMirror);
Expect.isFalse(metadata.hasReflectee);
Expect.throws(() => metadata.reflectee, (_) => true);
- Expect.isTrue(metadata is CommentInstanceMirror);
- Expect.equals(commentType.originalDeclaration, metadata.type);
- Expect.isFalse(metadata.isDocComment);
- Expect.stringEquals(
- "// This is intentionally the type literal.", metadata.text);
- Expect.stringEquals(
- "This is intentionally the type literal.", metadata.trimmedText);
+ Expect.isTrue(metadataType.isOriginalDeclaration);
+ InstanceMirror data = metadata.getField(#data);
+ Expect.isNotNull(data);
+ Expect.isTrue(data.hasReflectee);
+ Expect.isNull(data.reflectee);
// Singleline comment 1.
metadata = metadataList[metadataListIndex++];
@@ -241,17 +230,6 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.stringEquals(
"Singleline comment 2.", metadata.trimmedText);
- // @Metadata(null)
- metadata = metadataList[metadataListIndex++];
- Expect.isTrue(metadata is InstanceMirror);
- Expect.isFalse(metadata.hasReflectee);
- Expect.throws(() => metadata.reflectee, (_) => true);
- Expect.equals(metadataType.originalDeclaration, metadata.type);
- InstanceMirror data = metadata.getField(#data);
- Expect.isNotNull(data);
- Expect.isTrue(data.hasReflectee);
- Expect.isNull(data.reflectee);
-
// @Metadata(true)
metadata = metadataList[metadataListIndex++];
Expect.isTrue(metadata is InstanceMirror);
@@ -398,7 +376,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(351, fooClassLocation.length, "Unexpected length");
+ Expect.equals(298, fooClassLocation.length, "Unexpected length");
Expect.equals(18, fooClassLocation.line, "Unexpected line");
Expect.equals(1, fooClassLocation.column, "Unexpected column");
« no previous file with comments | « tests/compiler/dart2js/mirrors_helper.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698