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

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

Issue 2694433002: Stop testing scanner error lengths. (Closed)
Patch Set: Created 3 years, 10 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/test/scanner_fasta_test.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 aea7bf5f7e609571c698aef6a87c8797dc8896f1..7dd9e6b4bf18e2e40be111fa272379afebada470 100644
--- a/pkg/front_end/test/scanner_test.dart
+++ b/pkg/front_end/test/scanner_test.dart
@@ -1100,7 +1100,7 @@ abstract class ScannerTestBase {
ErrorListener listener = new ErrorListener();
scanWithListener(source, listener);
listener.assertErrors(
- [new TestError(expectedOffset, 1, expectedError, arguments)]);
+ [new TestError(expectedOffset, expectedError, arguments)]);
}
/**
@@ -1116,8 +1116,7 @@ abstract class ScannerTestBase {
String source, List<Token> expectedTokens) {
ErrorListener listener = new ErrorListener();
Token token = scanWithListener(source, listener);
- listener
- .assertErrors([new TestError(expectedOffset, 1, expectedError, null)]);
+ listener.assertErrors([new TestError(expectedOffset, expectedError, null)]);
_checkTokens(token, expectedTokens);
}
@@ -1263,15 +1262,14 @@ abstract class ScannerTestBase {
class TestError {
final int offset;
- final int length;
final ErrorCode errorCode;
final List<Object> arguments;
- TestError(this.offset, this.length, this.errorCode, this.arguments);
+ TestError(this.offset, this.errorCode, this.arguments);
@override
get hashCode {
- var h = new JenkinsSmiHash()..add(offset)..add(length)..add(errorCode);
+ var h = new JenkinsSmiHash()..add(offset)..add(errorCode);
if (arguments != null) {
for (Object argument in arguments) {
h.add(argument);
@@ -1284,7 +1282,6 @@ class TestError {
operator ==(Object other) {
if (other is TestError &&
offset == other.offset &&
- length == other.length &&
errorCode == other.errorCode) {
if (arguments == null) return other.arguments == null;
if (other.arguments == null) return false;
@@ -1299,9 +1296,8 @@ class TestError {
@override
toString() {
- var end = offset + length;
var argString = arguments == null ? '' : '(${arguments.join(', ')})';
- return 'Error($offset..$end, $errorCode$argString)';
+ return 'Error($offset, $errorCode$argString)';
}
}
@@ -1382,7 +1378,7 @@ class _TestScanner extends Scanner {
void reportError(
ScannerErrorCode errorCode, int offset, List<Object> arguments) {
if (listener != null) {
- listener.errors.add(new TestError(offset, 1, errorCode, arguments));
+ listener.errors.add(new TestError(offset, errorCode, arguments));
}
}
}
« no previous file with comments | « pkg/front_end/test/scanner_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698