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

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

Issue 2270903002: Remove 'Element.docRange'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/pubspec.yaml ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/all_the_rest_test.dart
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index dfae21a14a872780556cdd080400d106dc62dfab..196df31988769705ca56e19a57498a1935ffd069 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -718,7 +718,6 @@ class C {
expect(type.isMixinApplication, isFalse);
expect(type.isSynthetic, isFalse);
expect(type.documentationComment, '/// aaa');
- _assertHasDocRange(type, 50, 7);
_assertHasCodeRange(type, 50, 31);
}
@@ -985,7 +984,6 @@ class C {
expect(constructor, isNotNull);
_assertHasCodeRange(constructor, 50, 31);
expect(constructor.documentationComment, '/// aaa');
- _assertHasDocRange(constructor, 50, 7);
expect(constructor.isExternal, isFalse);
expect(constructor.isFactory, isFalse);
expect(constructor.name, "");
@@ -1188,7 +1186,6 @@ class C {
expect(enumElement, isNotNull);
_assertHasCodeRange(enumElement, 50, 31);
expect(enumElement.documentationComment, '/// aaa');
- _assertHasDocRange(enumElement, 50, 7);
expect(enumElement.name, enumName);
}
@@ -1214,7 +1211,6 @@ class C {
expect(firstField, isNotNull);
_assertHasCodeRange(firstField, 50, 61);
expect(firstField.documentationComment, '/// aaa');
- _assertHasDocRange(firstField, 50, 7);
expect(firstField.name, firstFieldName);
expect(firstField.initializer, isNull);
expect(firstField.isConst, isFalse);
@@ -1225,7 +1221,6 @@ class C {
expect(secondField, isNotNull);
_assertHasCodeRange(secondField, 50, 61);
expect(secondField.documentationComment, '/// aaa');
- _assertHasDocRange(secondField, 50, 7);
expect(secondField.name, secondFieldName);
expect(secondField.initializer, isNull);
expect(secondField.isConst, isFalse);
@@ -1346,7 +1341,6 @@ class C {
expect(accessor, isNotNull);
_assertHasCodeRange(accessor, 50, 31);
expect(accessor.documentationComment, '/// aaa');
- _assertHasDocRange(accessor, 50, 7);
expect(accessor.name, functionName);
expect(declaration.element, same(accessor));
expect(declaration.functionExpression.element, same(accessor));
@@ -1384,7 +1378,6 @@ class C {
expect(function, isNotNull);
_assertHasCodeRange(function, 50, 31);
expect(function.documentationComment, '/// aaa');
- _assertHasDocRange(function, 50, 7);
expect(function.hasImplicitReturnType, isFalse);
expect(function.name, functionName);
expect(declaration.element, same(function));
@@ -1416,7 +1409,6 @@ class C {
expect(accessor, isNotNull);
_assertHasCodeRange(accessor, 50, 31);
expect(accessor.documentationComment, '/// aaa');
- _assertHasDocRange(accessor, 50, 7);
expect(accessor.hasImplicitReturnType, isTrue);
expect(accessor.name, "$functionName=");
expect(declaration.element, same(accessor));
@@ -1497,7 +1489,6 @@ class C {
expect(alias, isNotNull);
_assertHasCodeRange(alias, 50, 31);
expect(alias.documentationComment, '/// aaa');
- _assertHasDocRange(alias, 50, 7);
expect(alias.name, aliasName);
expect(alias.parameters, hasLength(0));
List<TypeParameterElement> typeParameters = alias.typeParameters;
@@ -1698,7 +1689,6 @@ class A {
expect(getter, isNotNull);
_assertHasCodeRange(getter, 50, 31);
expect(getter.documentationComment, '/// aaa');
- _assertHasDocRange(getter, 50, 7);
expect(getter.hasImplicitReturnType, isTrue);
expect(getter.isAbstract, isFalse);
expect(getter.isExternal, isFalse);
@@ -1811,7 +1801,6 @@ class A {
expect(method, isNotNull);
_assertHasCodeRange(method, 50, 31);
expect(method.documentationComment, '/// aaa');
- _assertHasDocRange(method, 50, 7);
expect(method.hasImplicitReturnType, isFalse);
expect(method.name, methodName);
expect(method.functions, hasLength(0));
@@ -1888,7 +1877,6 @@ class A {
expect(setter, isNotNull);
_assertHasCodeRange(setter, 50, 31);
expect(setter.documentationComment, '/// aaa');
- _assertHasDocRange(setter, 50, 7);
expect(setter.hasImplicitReturnType, isTrue);
expect(setter.isAbstract, isFalse);
expect(setter.isExternal, isFalse);
@@ -2477,33 +2465,7 @@ class A {
expect(variable.setter, isNotNull);
}
- void test_visitVariableDeclaration_top_const_hasInitializer() {
- // const v = 42;
- ElementHolder holder = new ElementHolder();
- ElementBuilder builder = _makeBuilder(holder);
- String variableName = "v";
- VariableDeclaration variableDeclaration =
- AstFactory.variableDeclaration2(variableName, AstFactory.integer(42));
- AstFactory.variableDeclarationList2(Keyword.CONST, [variableDeclaration]);
- variableDeclaration.accept(builder);
-
- List<TopLevelVariableElement> variables = holder.topLevelVariables;
- expect(variables, hasLength(1));
- TopLevelVariableElement variable = variables[0];
- expect(variable, new isInstanceOf<ConstTopLevelVariableElementImpl>());
- expect(variable.initializer, isNotNull);
- expect(variable.initializer.type, isNotNull);
- expect(variable.initializer.hasImplicitReturnType, isTrue);
- expect(variable.name, variableName);
- expect(variable.hasImplicitType, isTrue);
- expect(variable.isConst, isTrue);
- expect(variable.isFinal, isFalse);
- expect(variable.isSynthetic, isFalse);
- expect(variable.getter, isNotNull);
- expect(variable.setter, isNull);
- }
-
- void test_visitVariableDeclaration_top_docRange() {
+ void test_visitVariableDeclaration_top() {
// final a, b;
ElementHolder holder = new ElementHolder();
ElementBuilder builder = _makeBuilder(holder);
@@ -2525,12 +2487,36 @@ class A {
TopLevelVariableElement variable1 = variables[0];
expect(variable1, isNotNull);
expect(variable1.documentationComment, '/// aaa');
- _assertHasDocRange(variable1, 50, 7);
TopLevelVariableElement variable2 = variables[1];
expect(variable2, isNotNull);
expect(variable2.documentationComment, '/// aaa');
- _assertHasDocRange(variable2, 50, 7);
+ }
+
+ void test_visitVariableDeclaration_top_const_hasInitializer() {
+ // const v = 42;
+ ElementHolder holder = new ElementHolder();
+ ElementBuilder builder = _makeBuilder(holder);
+ String variableName = "v";
+ VariableDeclaration variableDeclaration =
+ AstFactory.variableDeclaration2(variableName, AstFactory.integer(42));
+ AstFactory.variableDeclarationList2(Keyword.CONST, [variableDeclaration]);
+ variableDeclaration.accept(builder);
+
+ List<TopLevelVariableElement> variables = holder.topLevelVariables;
+ expect(variables, hasLength(1));
+ TopLevelVariableElement variable = variables[0];
+ expect(variable, new isInstanceOf<ConstTopLevelVariableElementImpl>());
+ expect(variable.initializer, isNotNull);
+ expect(variable.initializer.type, isNotNull);
+ expect(variable.initializer.hasImplicitReturnType, isTrue);
+ expect(variable.name, variableName);
+ expect(variable.hasImplicitType, isTrue);
+ expect(variable.isConst, isTrue);
+ expect(variable.isFinal, isFalse);
+ expect(variable.isSynthetic, isFalse);
+ expect(variable.getter, isNotNull);
+ expect(variable.setter, isNull);
}
void test_visitVariableDeclaration_top_final() {
@@ -2562,15 +2548,6 @@ class A {
expect(elementImpl.codeLength, length);
}
- void _assertHasDocRange(
- Element element, int expectedOffset, int expectedLength) {
- // Cast to dynamic here to avoid a hint about @deprecated docRange.
- SourceRange docRange = (element as dynamic).docRange;
- expect(docRange, isNotNull);
- expect(docRange.offset, expectedOffset);
- expect(docRange.length, expectedLength);
- }
-
void _assertVisibleRange(LocalElement element, int offset, int end) {
SourceRange visibleRange = element.visibleRange;
expect(visibleRange.offset, offset);
@@ -3124,8 +3101,6 @@ class EnumMemberBuilderTest extends EngineTestCase {
expect(constant.isStatic, isTrue);
expect((constant as FieldElementImpl).evaluationResult, isNotNull);
expect(constant.documentationComment, '/// aaa');
- expect(constant.docRange.offset, 50);
- expect(constant.docRange.length, 7);
_assertGetter(constant);
}
@@ -4134,7 +4109,7 @@ void f() {
_assertNthStatementDoesNotExit(source, 0);
}
- void test_whileStatement_breakWithLabel_afterExting() {
+ void test_whileStatement_breakWithLabel_afterExiting() {
Source source = addSource(r'''
void f() {
x: while (true) {
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698