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 01b1aa594e1a881273cd619bbd3130ea1c22edae..567373fe8a9af0891254bb81c0d0f3d449daae14 100644 |
--- a/pkg/front_end/test/scanner_fasta_test.dart |
+++ b/pkg/front_end/test/scanner_fasta_test.dart |
@@ -225,6 +225,26 @@ main() {} |
} |
} |
+ void test_double_error() { |
+ String source = "3457e"; |
+ ErrorListener listener = new ErrorListener(); |
+ Token token = scanWithListener(source, listener); |
+ expect(token, isNotNull); |
+ expect(token.type, TokenType.DOUBLE); |
+ expect(token.offset, 0); |
+ expect(token.isSynthetic, isTrue); |
+ // the invalid token is updated to be valid ... |
+ expect(token.lexeme, source + "0"); |
+ // ... but the length does *not* include the additional character |
+ // so as to be true to the original source. |
+ expect(token.length, source.length); |
+ expect(token.next.isEof, isTrue); |
+ expect(listener.errors, hasLength(1)); |
+ TestError error = listener.errors[0]; |
+ expect(error.errorCode, ScannerErrorCode.MISSING_DIGIT); |
+ expect(error.offset, source.length - 1); |
+ } |
+ |
@override |
void test_mismatched_opener_in_interpolation() { |
// When openers and closers are mismatched, |