| 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 'dart:async'; |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/src/dart/ast/utilities.dart'; | 11 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| 11 import 'package:analyzer/src/generated/java_engine.dart'; | 12 import 'package:analyzer/src/generated/java_engine.dart'; |
| 12 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 13 import 'package:test/test.dart'; | 14 import 'package:test/test.dart'; |
| 14 | 15 |
| 15 import 'abstract_context.dart'; | 16 import 'abstract_context.dart'; |
| 16 | 17 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 92 } |
| 92 if (c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0)) { | 93 if (c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0)) { |
| 93 length++; | 94 length++; |
| 94 continue; | 95 continue; |
| 95 } | 96 } |
| 96 break; | 97 break; |
| 97 } | 98 } |
| 98 return length; | 99 return length; |
| 99 } | 100 } |
| 100 | 101 |
| 101 void resolveTestUnit(String code) { | 102 Future<Null> resolveTestUnit(String code) async { |
| 102 addTestSource(code); | 103 addTestSource(code); |
| 103 testUnit = resolveLibraryUnit(testSource); | 104 testUnit = await resolveLibraryUnit(testSource); |
| 104 if (verifyNoTestUnitErrors) { | 105 if (verifyNoTestUnitErrors) { |
| 105 assertNoErrorsInSource(testSource); | 106 assertNoErrorsInSource(testSource); |
| 106 } | 107 } |
| 107 testUnitElement = testUnit.element; | 108 testUnitElement = testUnit.element; |
| 108 testLibraryElement = testUnitElement.library; | 109 testLibraryElement = testUnitElement.library; |
| 109 } | 110 } |
| 110 } | 111 } |
| OLD | NEW |