| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.services.src.index.abstract_single_file; | 5 library test.services.src.index.abstract_single_file; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/java_engine.dart'; | 10 import 'package:analyzer/src/generated/java_engine.dart'; |
| 11 import 'package:analyzer/src/generated/source.dart'; | 11 import 'package:analyzer/src/generated/source.dart'; |
| 12 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
| 13 | 13 |
| 14 import 'abstract_context.dart'; | 14 import 'abstract_context.dart'; |
| 15 | 15 |
| 16 | |
| 17 class AbstractSingleUnitTest extends AbstractContextTest { | 16 class AbstractSingleUnitTest extends AbstractContextTest { |
| 18 bool verifyNoTestUnitErrors = true; | 17 bool verifyNoTestUnitErrors = true; |
| 19 | 18 |
| 20 String testCode; | 19 String testCode; |
| 21 String testFile = '/test.dart'; | 20 String testFile = '/test.dart'; |
| 22 Source testSource; | 21 Source testSource; |
| 23 CompilationUnit testUnit; | 22 CompilationUnit testUnit; |
| 24 CompilationUnitElement testUnitElement; | 23 CompilationUnitElement testUnitElement; |
| 25 LibraryElement testLibraryElement; | 24 LibraryElement testLibraryElement; |
| 26 | 25 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void resolveTestUnit(String code) { | 100 void resolveTestUnit(String code) { |
| 102 addTestSource(code); | 101 addTestSource(code); |
| 103 testUnit = resolveLibraryUnit(testSource); | 102 testUnit = resolveLibraryUnit(testSource); |
| 104 if (verifyNoTestUnitErrors) { | 103 if (verifyNoTestUnitErrors) { |
| 105 assertNoErrorsInSource(testSource); | 104 assertNoErrorsInSource(testSource); |
| 106 } | 105 } |
| 107 testUnitElement = testUnit.element; | 106 testUnitElement = testUnit.element; |
| 108 testLibraryElement = testUnitElement.library; | 107 testLibraryElement = testUnitElement.library; |
| 109 } | 108 } |
| 110 } | 109 } |
| OLD | NEW |