| Index: pkg/front_end/test/scanner_fasta_test.dart
|
| diff --git a/pkg/front_end/test/scanner_fasta_test.dart b/pkg/front_end/test/scanner_fasta_test.dart
|
| index 9e7564def0dc2cb6ed504681b4cd3c568d0965fe..f6b8cc1cacb3ff7144907705bfae43abdc31e21a 100644
|
| --- a/pkg/front_end/test/scanner_fasta_test.dart
|
| +++ b/pkg/front_end/test/scanner_fasta_test.dart
|
| @@ -3,6 +3,7 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| import 'package:analyzer/src/fasta/token_utils.dart';
|
| +import 'package:front_end/src/fasta/fasta_codes.dart';
|
| import 'package:front_end/src/fasta/scanner/error_token.dart' as fasta;
|
| import 'package:front_end/src/fasta/scanner/string_scanner.dart' as fasta;
|
| import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
|
| @@ -23,6 +24,10 @@ main() {
|
|
|
| @reflectiveTest
|
| class ScannerTest_Fasta extends ScannerTestBase {
|
| + ScannerTest_Fasta() {
|
| + usingFasta = true;
|
| + }
|
| +
|
| @override
|
| Token scanWithListener(String source, ErrorListener listener,
|
| {bool genericMethodComments: false,
|
| @@ -179,14 +184,6 @@ main() {}
|
|
|
| @override
|
| @failingTest
|
| - void test_incomplete_string_interpolation() {
|
| - // TODO(danrubel): fix ToAnalyzerTokenStreamConverter_WithListener
|
| - // to handle synthetic closers in token stream
|
| - super.test_incomplete_string_interpolation();
|
| - }
|
| -
|
| - @override
|
| - @failingTest
|
| void test_mismatched_closer() {
|
| // TODO(paulberry,ahe): Fasta and analyzer recover this error differently.
|
| // Figure out which recovery technique we want the front end to use.
|
| @@ -503,6 +500,32 @@ class ScannerTest_Fasta_Direct extends ScannerTest_Fasta_Base {
|
| var scanner = new fasta.StringScanner(source, includeComments: true);
|
| return scanner.tokenize();
|
| }
|
| +
|
| + test_unterminated_string_with_unterminated_interpolation() {
|
| + Token token = scan(r'"foo ${bar');
|
| + BeginToken interpolationStart = token.next;
|
| +
|
| + Token previous;
|
| + while (token.kind != fasta.BAD_INPUT_TOKEN) {
|
| + expect(token.isEof, isFalse);
|
| + previous = token;
|
| + token = token.next;
|
| + }
|
| +
|
| + // Expect interpolation to be terminated before string is closed
|
| +
|
| + token = previous;
|
| + expect(token.isSynthetic, isTrue);
|
| + expect(token.length, 0);
|
| + expect(token.stringValue, '}');
|
| +
|
| + token = token.next;
|
| + expect((token as fasta.ErrorToken).errorCode, same(codeUnmatchedToken));
|
| + expect((token as fasta.UnmatchedToken).begin, same(interpolationStart));
|
| +
|
| + token = token.next;
|
| + expect((token as fasta.ErrorToken).errorCode, same(codeUnterminatedString));
|
| + }
|
| }
|
|
|
| /// Override of [ToAnalyzerTokenStreamConverter] that verifies that there are no
|
|
|