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

Unified Diff: pkg/analyzer_experimental/test/generated/ast_test.dart

Issue 14205011: Issue 9845. Compare runtime types using ==. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: pkg/analyzer_experimental/test/generated/ast_test.dart
diff --git a/pkg/analyzer_experimental/test/generated/ast_test.dart b/pkg/analyzer_experimental/test/generated/ast_test.dart
index 47f90f5aa9564d56086a7cf1d50bf3e474aa3673..dc43398575e261698d3b2039d00c05e3a01a1dcb 100644
--- a/pkg/analyzer_experimental/test/generated/ast_test.dart
+++ b/pkg/analyzer_experimental/test/generated/ast_test.dart
@@ -23,6 +23,18 @@ class NodeLocatorTest extends ParserTestCase {
CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
assertLocate(unit, 10, SimpleIdentifier);
}
+ void test_offsetAfterNode() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+ NodeLocator locator = new NodeLocator.con2(1024, 1024);
+ ASTNode node = locator.searchWithin(unit.declarations[0]);
+ JUnitTestCase.assertNull(node);
+ }
+ void test_offsetBeforeNode() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+ NodeLocator locator = new NodeLocator.con2(0, 0);
+ ASTNode node = locator.searchWithin(unit.declarations[1]);
+ JUnitTestCase.assertNull(node);
+ }
void test_range() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
assertLocate2(unit, 4, 10, LibraryDirective);
@@ -44,6 +56,14 @@ class NodeLocatorTest extends ParserTestCase {
final __test = new NodeLocatorTest();
runJUnitTest(__test, __test.test_offset);
});
+ _ut.test('test_offsetAfterNode', () {
+ final __test = new NodeLocatorTest();
+ runJUnitTest(__test, __test.test_offsetAfterNode);
+ });
+ _ut.test('test_offsetBeforeNode', () {
+ final __test = new NodeLocatorTest();
+ runJUnitTest(__test, __test.test_offsetBeforeNode);
+ });
_ut.test('test_range', () {
final __test = new NodeLocatorTest();
runJUnitTest(__test, __test.test_range);
@@ -556,10 +576,10 @@ class SimpleIdentifierTest extends ParserTestCase {
*/
ASTNode topMostNode(SimpleIdentifier identifier) {
ASTNode child = identifier;
- ASTNode parent19 = identifier.parent;
- while (parent19 != null) {
- child = parent19;
- parent19 = parent19.parent;
+ ASTNode parent20 = identifier.parent;
+ while (parent20 != null) {
+ child = parent20;
+ parent20 = parent20.parent;
}
return child;
}

Powered by Google App Engine
This is Rietveld 408576698