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

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

Issue 1061883002: Fix tests broken by r44880. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/lib/src/generated/ast.dart ('k') | tests/co19/co19-analyzer2.status » ('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 2b716bf29e7e75408f8efe6b77d2fbc979fad812..593892623ca06f2cb7509cc94450c71508a2fb9a 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -1941,6 +1941,70 @@ class Foo {
"int x; ; int y;", [ParserErrorCode.UNEXPECTED_TOKEN]);
}
+ void test_unterminatedString_at_eof() {
+ // Although the "unterminated string" error message is produced by the
+ // scanner, we need to verify that the parser can handle the tokens
+ // produced by the scanner when an unterminated string is encountered.
+ ParserTestCase.parseCompilationUnit(r'''
+void main() {
+ var x = "''', [
+ ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.EXPECTED_TOKEN
+ ]);
+ }
+
+ void test_unterminatedString_at_eol() {
+ // Although the "unterminated string" error message is produced by the
+ // scanner, we need to verify that the parser can handle the tokens
+ // produced by the scanner when an unterminated string is encountered.
+ ParserTestCase.parseCompilationUnit(r'''
+void main() {
+ var x = "
+;
+}
+''', [ScannerErrorCode.UNTERMINATED_STRING_LITERAL]);
+ }
+
+ void test_unterminatedString_multiline_at_eof_3_quotes() {
+ // Although the "unterminated string" error message is produced by the
+ // scanner, we need to verify that the parser can handle the tokens
+ // produced by the scanner when an unterminated string is encountered.
+ ParserTestCase.parseCompilationUnit(r'''
+void main() {
+ var x = """''', [
+ ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.EXPECTED_TOKEN
+ ]);
+ }
+
+ void test_unterminatedString_multiline_at_eof_4_quotes() {
+ // Although the "unterminated string" error message is produced by the
+ // scanner, we need to verify that the parser can handle the tokens
+ // produced by the scanner when an unterminated string is encountered.
+ ParserTestCase.parseCompilationUnit(r'''
+void main() {
+ var x = """"''', [
+ ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.EXPECTED_TOKEN
+ ]);
+ }
+
+ void test_unterminatedString_multiline_at_eof_5_quotes() {
+ // Although the "unterminated string" error message is produced by the
+ // scanner, we need to verify that the parser can handle the tokens
+ // produced by the scanner when an unterminated string is encountered.
+ ParserTestCase.parseCompilationUnit(r'''
+void main() {
+ var x = """""''', [
+ ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.EXPECTED_TOKEN
+ ]);
+ }
+
void test_useOfUnaryPlusOperator() {
SimpleIdentifier expression = parse4(
"parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | tests/co19/co19-analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698