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

Unified Diff: pkg/front_end/test/scanner_replacement_test.dart

Issue 3004573002: remove old fasta missing exponent recovery (Closed)
Patch Set: Created 3 years, 4 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/front_end/lib/src/fasta/scanner/recover.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/scanner_replacement_test.dart
diff --git a/pkg/front_end/test/scanner_replacement_test.dart b/pkg/front_end/test/scanner_replacement_test.dart
index 5d0a51a87d0897c2cd45a84f231900f8a3dfc3a5..824a1d3b6ea461875f0561516d86062d4418b66b 100644
--- a/pkg/front_end/test/scanner_replacement_test.dart
+++ b/pkg/front_end/test/scanner_replacement_test.dart
@@ -90,6 +90,25 @@ class ScannerTest_Replacement extends ScannerTestBase {
]);
}
+ void test_double_error() {
+ String source = "3457e";
+ ErrorListener listener = new ErrorListener();
+ analyzer.Token token = scanWithListener(source, listener);
+ expect(token.type, analyzer.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);
+ }
+
void test_lt() {
// fasta does not automatically insert a closer for '<'
// because it could be part of an expression rather than an opener
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/recover.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698