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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10949015: Issue 5052. Analyzer should treat assert as a keyword (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index c7c0ee17ff1cdfad0652e170e97008ea34e0db53..4c260c8812a33b81c984f1a370300e412055ddae 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -1149,57 +1149,16 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
" assert(true, false);", // not single argument
" assert;", // incomplete
"}",
- "foo() => assert(true);", // 'assert' is statement, not expression
"");
assertErrors(
libraryResult.getErrors(),
- errEx(ResolverErrorCode.CANNOT_RESOLVE_METHOD, 13, 3, 6),
- errEx(ResolverErrorCode.CANNOT_BE_RESOLVED, 14, 3, 6),
+ errEx(ParserErrorCode.EXPECTED_TOKEN, 13, 10, 4),
+ errEx(ParserErrorCode.EXPECTED_TOKEN, 14, 9, 1),
errEx(TypeErrorCode.ASSERT_BOOL, 5, 10, 9),
errEx(TypeErrorCode.ASSERT_BOOL, 6, 10, 6),
errEx(TypeErrorCode.ASSERT_BOOL, 7, 10, 1),
errEx(TypeErrorCode.ASSERT_BOOL, 11, 10, 13),
- errEx(TypeErrorCode.ASSERT_BOOL, 12, 10, 12),
- errEx(TypeErrorCode.ASSERT_IS_STATEMENT, 16, 10, 12));
- }
-
- public void test_assert_isUserFunction() throws Exception {
- AnalyzeLibraryResult libraryResult = analyzeLibrary(
- "// filler filler filler filler filler filler filler filler filler filler",
- "assert(x) {}",
- "main() {",
- " assert(true);",
- " assert(false);",
- " assert('message');",
- "}",
- "");
- assertErrors(libraryResult.getErrors());
- }
-
- public void test_assert_asLocalVariable() throws Exception {
- AnalyzeLibraryResult libraryResult = analyzeLibrary(
- "// filler filler filler filler filler filler filler filler filler filler",
- "main() {",
- " bool assert;",
- " assert;",
- "}",
- "");
- assertErrors(libraryResult.getErrors());
- }
-
- public void test_assert_asInheritedGetter() throws Exception {
- AnalyzeLibraryResult libraryResult = analyzeLibrary(
- "// filler filler filler filler filler filler filler filler filler filler",
- "class A {",
- " get assert() {}",
- "}",
- "class B extends A {",
- " foo() {",
- " assert;",
- " }",
- "}",
- "");
- assertErrors(libraryResult.getErrors());
+ errEx(TypeErrorCode.ASSERT_BOOL, 12, 10, 12));
}
/**

Powered by Google App Engine
This is Rietveld 408576698