Index: pkg/front_end/test/scanner_test.dart |
diff --git a/pkg/front_end/test/scanner_test.dart b/pkg/front_end/test/scanner_test.dart |
index ca8d75e126ca7ac18a1001683c117d87518b9167..886695bfcfe570a3e4beae144fbe45099afc5e2b 100644 |
--- a/pkg/front_end/test/scanner_test.dart |
+++ b/pkg/front_end/test/scanner_test.dart |
@@ -439,6 +439,7 @@ abstract class ScannerTestBase { |
// fasta inserts synthetic closers |
expectedTokens.addAll([ |
new SyntheticToken(TokenType.CLOSE_CURLY_BRACKET, 10), |
+ new SyntheticStringToken(TokenType.STRING, '"', 10, 0), |
]); |
} else { |
expectedTokens.addAll([ |
@@ -992,8 +993,17 @@ abstract class ScannerTestBase { |
} |
void test_string_multi_unterminated() { |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, "'''string", 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'''", 9, 0), |
+ ]); |
+ } |
_assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, |
- "'''string", [new StringToken(TokenType.STRING, "'''string", 0)]); |
+ "'''string", expectedTokens); |
} |
void test_string_multi_unterminated_interpolation_block() { |
@@ -1026,8 +1036,17 @@ abstract class ScannerTestBase { |
void test_string_raw_multi_unterminated() { |
String source = "r'''string"; |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, source, 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'''", 10, 0), |
+ ]); |
+ } |
_assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, |
- source, [new StringToken(TokenType.STRING, source, 0)]); |
+ source, expectedTokens); |
} |
void test_string_raw_simple_double() { |
@@ -1040,14 +1059,32 @@ abstract class ScannerTestBase { |
void test_string_raw_simple_unterminated_eof() { |
String source = "r'string"; |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, source, 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'", 8, 0), |
+ ]); |
+ } |
_assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, |
- source, [new StringToken(TokenType.STRING, source, 0)]); |
+ source, expectedTokens); |
} |
void test_string_raw_simple_unterminated_eol() { |
- String source = "r'string"; |
- _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, |
- "$source\n", [new StringToken(TokenType.STRING, source, 0)]); |
+ String source = "r'string\n"; |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, "r'string", 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'", 8, 0), |
+ ]); |
+ } |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ usingFasta ? 7 : 8, source, expectedTokens); |
} |
void test_string_simple_double() { |
@@ -1143,14 +1180,32 @@ abstract class ScannerTestBase { |
void test_string_simple_unterminated_eof() { |
String source = "'string"; |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, source, 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'", 7, 0), |
+ ]); |
+ } |
_assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, |
- source, [new StringToken(TokenType.STRING, source, 0)]); |
+ source, expectedTokens); |
} |
void test_string_simple_unterminated_eol() { |
- String source = "'string"; |
- _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, |
- "$source\r", [new StringToken(TokenType.STRING, source, 0)]); |
+ String source = "'string\r"; |
+ List<Token> expectedTokens = [ |
+ new StringToken(TokenType.STRING, "'string", 0), |
+ ]; |
+ if (usingFasta) { |
+ // fasta inserts synthetic closers |
+ expectedTokens.addAll([ |
+ new SyntheticStringToken(TokenType.STRING, "'", 7, 0), |
+ ]); |
+ } |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ usingFasta ? 6 : 7, source, expectedTokens); |
} |
void test_string_simple_unterminated_interpolation_block() { |