| 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 library analyzer.test.constant_test; | 5 library analyzer.test.constant_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer/src/dart/element/element.dart'; | 10 import 'package:analyzer/src/dart/element/element.dart'; |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 void setUp() { | 2206 void setUp() { |
| 2207 _referenceGraph = new DirectedGraph<ConstantEvaluationTarget>(); | 2207 _referenceGraph = new DirectedGraph<ConstantEvaluationTarget>(); |
| 2208 _head = ElementFactory.topLevelVariableElement2("v1"); | 2208 _head = ElementFactory.topLevelVariableElement2("v1"); |
| 2209 } | 2209 } |
| 2210 | 2210 |
| 2211 void test_visitSimpleIdentifier_const() { | 2211 void test_visitSimpleIdentifier_const() { |
| 2212 _visitNode(_makeTailVariable("v2", true)); | 2212 _visitNode(_makeTailVariable("v2", true)); |
| 2213 _assertOneArc(_tail); | 2213 _assertOneArc(_tail); |
| 2214 } | 2214 } |
| 2215 | 2215 |
| 2216 void test_visitSimpleIdentifier_nonConst() { | |
| 2217 _visitNode(_makeTailVariable("v2", false)); | |
| 2218 _assertOneArc(_tail); | |
| 2219 } | |
| 2220 | |
| 2221 void test_visitSuperConstructorInvocation_const() { | 2216 void test_visitSuperConstructorInvocation_const() { |
| 2222 _visitNode(_makeTailSuperConstructorInvocation("A", true)); | 2217 _visitNode(_makeTailSuperConstructorInvocation("A", true)); |
| 2223 _assertOneArc(_tail); | 2218 _assertOneArc(_tail); |
| 2224 } | 2219 } |
| 2225 | 2220 |
| 2226 void test_visitSuperConstructorInvocation_nonConst() { | 2221 void test_visitSuperConstructorInvocation_nonConst() { |
| 2227 _visitNode(_makeTailSuperConstructorInvocation("A", false)); | 2222 _visitNode(_makeTailSuperConstructorInvocation("A", false)); |
| 2228 _assertOneArc(_tail); | 2223 _assertOneArc(_tail); |
| 2229 } | 2224 } |
| 2230 | 2225 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2286 | 2281 |
| 2287 void _visitNode(AstNode node) { | 2282 void _visitNode(AstNode node) { |
| 2288 node.accept(_createReferenceFinder(_head)); | 2283 node.accept(_createReferenceFinder(_head)); |
| 2289 } | 2284 } |
| 2290 } | 2285 } |
| 2291 | 2286 |
| 2292 class _TestAnalysisContext extends TestAnalysisContext { | 2287 class _TestAnalysisContext extends TestAnalysisContext { |
| 2293 @override | 2288 @override |
| 2294 InternalAnalysisContext getContextFor(Source source) => this; | 2289 InternalAnalysisContext getContextFor(Source source) => this; |
| 2295 } | 2290 } |
| OLD | NEW |