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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2996163002: support class native clause (Closed)
Patch Set: update DietListener and test Created 3 years, 4 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 | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | pkg/analyzer/tool/summary/mini_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 6eb0bfcf606957c62c5723a373c97397b4b9e7e6..70c5dcff314b298aac6f5992d9631fda5e417b9b 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -42,6 +42,8 @@ main() {
* which parser is used.
*/
abstract class AbstractParserTestCase implements ParserTestHelpers {
+ bool get allowNativeClause;
+
void set enableAssertInitializer(bool value);
void set enableGenericMethodComments(bool value);
@@ -8284,6 +8286,9 @@ class ParserTestCase extends EngineTestCase
*/
static bool parseFunctionBodies = true;
+ @override
+ bool allowNativeClause = true;
+
/**
* A flag indicating whether the parser is to parse asserts in the initializer
* list of a constructor.
@@ -13809,7 +13814,13 @@ abstract class TopLevelParserTestMixin implements AbstractParserTestCase {
createParser('class A native "nativeValue" {}');
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
- assertNoErrors();
+ if (!allowNativeClause) {
+ assertErrorsWithCodes([
+ ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION,
+ ]);
+ } else {
+ assertNoErrors();
+ }
expect(member, new isInstanceOf<ClassDeclaration>());
ClassDeclaration declaration = member;
NativeClause nativeClause = declaration.nativeClause;
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | pkg/analyzer/tool/summary/mini_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698