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

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

Issue 2842213003: new TokenType and Keyword API (Closed)
Patch Set: rebase Created 3 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/front_end/lib/src/scanner/token.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_test.dart
diff --git a/pkg/front_end/test/scanner_test.dart b/pkg/front_end/test/scanner_test.dart
index 6737d293bbb55d9fa728095d699b0e317980afc9..48f199ecac4960eda3874b36ddfe414b15752027 100644
--- a/pkg/front_end/test/scanner_test.dart
+++ b/pkg/front_end/test/scanner_test.dart
@@ -90,7 +90,7 @@ class KeywordStateTest {
int keywordCount = keywords.length;
List<String> textToTest = new List<String>(keywordCount * 3);
for (int i = 0; i < keywordCount; i++) {
- String syntax = keywords[i].syntax;
+ String syntax = keywords[i].lexeme;
textToTest[i] = syntax;
textToTest[i + keywordCount] = "${syntax}x";
textToTest[i + keywordCount * 2] = syntax.substring(0, syntax.length - 1);
@@ -180,7 +180,7 @@ abstract class ScannerTestBase {
void test_async_star() {
Token token = _scan("async*");
- expect(token.type, TokenType.KEYWORD);
+ expect(token.type.isKeyword, true);
expect(token.lexeme, 'async');
expect(token.next.type, TokenType.STAR);
expect(token.next.next.type, TokenType.EOF);
@@ -1168,7 +1168,7 @@ abstract class ScannerTestBase {
void test_sync_star() {
Token token = _scan("sync*");
- expect(token.type, TokenType.KEYWORD);
+ expect(token.type.isKeyword, true);
expect(token.lexeme, 'sync');
expect(token.next.type, TokenType.STAR);
expect(token.next.next.type, TokenType.EOF);
@@ -1270,22 +1270,22 @@ abstract class ScannerTestBase {
void _assertKeywordToken(String source) {
Token token = _scan(source);
expect(token, isNotNull);
- expect(token.type, TokenType.KEYWORD);
+ expect(token.type.isKeyword, true);
expect(token.offset, 0);
expect(token.length, source.length);
expect(token.lexeme, source);
Object value = token.value();
expect(value is Keyword, isTrue);
- expect((value as Keyword).syntax, source);
+ expect((value as Keyword).lexeme, source);
token = _scan(" $source ");
expect(token, isNotNull);
- expect(token.type, TokenType.KEYWORD);
+ expect(token.type.isKeyword, true);
expect(token.offset, 1);
expect(token.length, source.length);
expect(token.lexeme, source);
value = token.value();
expect(value is Keyword, isTrue);
- expect((value as Keyword).syntax, source);
+ expect((value as Keyword).lexeme, source);
expect(token.next.type, TokenType.EOF);
}
« no previous file with comments | « pkg/front_end/lib/src/scanner/token.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698