Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:front_end/src/base/errors.dart'; | 5 import 'package:front_end/src/base/errors.dart'; |
| 6 import 'package:front_end/src/base/jenkins_smi_hash.dart'; | 6 import 'package:front_end/src/base/jenkins_smi_hash.dart'; |
| 7 import 'package:front_end/src/scanner/errors.dart'; | 7 import 'package:front_end/src/scanner/errors.dart'; |
| 8 import 'package:front_end/src/scanner/reader.dart'; | 8 import 'package:front_end/src/scanner/reader.dart'; |
| 9 import 'package:front_end/src/scanner/scanner.dart'; | 9 import 'package:front_end/src/scanner/scanner.dart'; |
| 10 import 'package:front_end/src/scanner/token.dart'; | 10 import 'package:front_end/src/scanner/token.dart'; |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1183 | 1183 |
| 1184 void test_unclosedPairInInterpolation() { | 1184 void test_unclosedPairInInterpolation() { |
| 1185 ErrorListener listener = new ErrorListener(); | 1185 ErrorListener listener = new ErrorListener(); |
| 1186 scanWithListener("'\${(}'", listener); | 1186 scanWithListener("'\${(}'", listener); |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 void test_unmatched_openers() { | 1189 void test_unmatched_openers() { |
| 1190 var openBrace = _scan('{[(') as BeginToken; | 1190 var openBrace = _scan('{[(') as BeginToken; |
| 1191 var openBracket = openBrace.next as BeginToken; | 1191 var openBracket = openBrace.next as BeginToken; |
| 1192 var openParen = openBracket.next as BeginToken; | 1192 var openParen = openBracket.next as BeginToken; |
| 1193 expect(openBrace.previous.type, TokenType.EOF); | |
|
Paul Berry
2017/02/16 22:07:54
This seems like a weird place to test this functio
danrubel
2017/02/21 14:49:27
Good points. Found an already existing test_startA
| |
| 1193 expect(openParen.next.type, TokenType.EOF); | 1194 expect(openParen.next.type, TokenType.EOF); |
| 1194 expect(openBrace.endToken, isNull); | 1195 expect(openBrace.endToken, isNull); |
| 1195 expect(openBracket.endToken, isNull); | 1196 expect(openBracket.endToken, isNull); |
| 1196 expect(openParen.endToken, isNull); | 1197 expect(openParen.endToken, isNull); |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 void _assertComment(TokenType commentType, String source, | 1200 void _assertComment(TokenType commentType, String source, |
| 1200 {bool genericMethodComments: false}) { | 1201 {bool genericMethodComments: false}) { |
| 1201 // | 1202 // |
| 1202 // Test without a trailing end-of-line marker | 1203 // Test without a trailing end-of-line marker |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1512 _TestScanner(CharacterReader reader, [this.listener]) : super(reader); | 1513 _TestScanner(CharacterReader reader, [this.listener]) : super(reader); |
| 1513 | 1514 |
| 1514 @override | 1515 @override |
| 1515 void reportError( | 1516 void reportError( |
| 1516 ScannerErrorCode errorCode, int offset, List<Object> arguments) { | 1517 ScannerErrorCode errorCode, int offset, List<Object> arguments) { |
| 1517 if (listener != null) { | 1518 if (listener != null) { |
| 1518 listener.errors.add(new TestError(offset, errorCode, arguments)); | 1519 listener.errors.add(new TestError(offset, errorCode, arguments)); |
| 1519 } | 1520 } |
| 1520 } | 1521 } |
| 1521 } | 1522 } |
| OLD | NEW |