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

Unified Diff: pkg/analyzer/test/generated/scanner_test.dart

Issue 221483002: Fix for translation of \!= to \!identical(), but use == and \!= for Enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/analyzer/test/generated/resolver_test.dart ('k') | pkg/analyzer/test/generated/test_support.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/scanner_test.dart
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index a0769fed020ba17aba3e040fd3bb84ee980111bb..0d521886d7ec31be052af6aad2fe7491d5470382 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -265,7 +265,7 @@ class TokenStreamValidator {
while (currentToken != null && currentToken.type != TokenType.EOF) {
_validateStream(builder, currentToken.precedingComments);
TokenType type = currentToken.type;
- if (identical(type, TokenType.OPEN_CURLY_BRACKET) || identical(type, TokenType.OPEN_PAREN) || identical(type, TokenType.OPEN_SQUARE_BRACKET) || identical(type, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
+ if (type == TokenType.OPEN_CURLY_BRACKET || type == TokenType.OPEN_PAREN || type == TokenType.OPEN_SQUARE_BRACKET || type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
if (currentToken is! BeginToken) {
builder.append("\r\nExpected BeginToken, found ");
builder.append(currentToken.runtimeType.toString());
@@ -1145,10 +1145,10 @@ class ScannerTest extends JUnitTestCase {
JUnitTestCase.assertEquals(0, originalToken.offset);
JUnitTestCase.assertEquals(source.length, originalToken.length);
JUnitTestCase.assertEquals(source, originalToken.lexeme);
- if (identical(expectedType, TokenType.SCRIPT_TAG)) {
+ if (expectedType == TokenType.SCRIPT_TAG) {
// Adding space before the script tag is not allowed, and adding text at the end changes nothing.
return originalToken;
- } else if (identical(expectedType, TokenType.SINGLE_LINE_COMMENT)) {
+ } else if (expectedType == TokenType.SINGLE_LINE_COMMENT) {
// Adding space to an end-of-line comment changes the comment.
Token tokenWithSpaces = _scan(" ${source}");
JUnitTestCase.assertNotNull(tokenWithSpaces);
@@ -1157,7 +1157,7 @@ class ScannerTest extends JUnitTestCase {
JUnitTestCase.assertEquals(source.length, tokenWithSpaces.length);
JUnitTestCase.assertEquals(source, tokenWithSpaces.lexeme);
return originalToken;
- } else if (identical(expectedType, TokenType.INT) || identical(expectedType, TokenType.DOUBLE)) {
+ } else if (expectedType == TokenType.INT || expectedType == TokenType.DOUBLE) {
Token tokenWithLowerD = _scan("${source}d");
JUnitTestCase.assertNotNull(tokenWithLowerD);
JUnitTestCase.assertEquals(expectedType, tokenWithLowerD.type);
@@ -1880,17 +1880,13 @@ class ScannerTest extends JUnitTestCase {
* of a given offset in source code.
*/
class ScannerTest_ExpectedLocation {
- int _offset = 0;
+ final int _offset;
- int _lineNumber = 0;
+ final int _lineNumber;
- int _columnNumber = 0;
+ final int _columnNumber;
- ScannerTest_ExpectedLocation(int offset, int lineNumber, int columnNumber) {
- this._offset = offset;
- this._lineNumber = lineNumber;
- this._columnNumber = columnNumber;
- }
+ ScannerTest_ExpectedLocation(this._offset, this._lineNumber, this._columnNumber);
}
class IncrementalScannerTest extends EngineTestCase {
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | pkg/analyzer/test/generated/test_support.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698