OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/constant/value.dart'; | 8 import 'package:analyzer/dart/constant/value.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 class C {} | 3427 class C {} |
3428 class D extends p.C {} // Prevent "unused import" warning | 3428 class D extends p.C {} // Prevent "unused import" warning |
3429 '''); | 3429 '''); |
3430 expect(resynthesized.imports, hasLength(2)); | 3430 expect(resynthesized.imports, hasLength(2)); |
3431 expect(resynthesized.imports[0].importedLibrary.location, | 3431 expect(resynthesized.imports[0].importedLibrary.location, |
3432 resynthesized.location); | 3432 resynthesized.location); |
3433 expect(resynthesized.imports[1].importedLibrary.isDartCore, true); | 3433 expect(resynthesized.imports[1].importedLibrary.isDartCore, true); |
3434 } | 3434 } |
3435 | 3435 |
3436 test_import_short_absolute() { | 3436 test_import_short_absolute() { |
| 3437 if (resourceProvider.pathContext.separator == '\\') { |
| 3438 // This test fails on Windows due to |
| 3439 // https://github.com/dart-lang/path/issues/18 |
| 3440 // TODO(paulberry): reenable once that bug is addressed. |
| 3441 return; |
| 3442 } |
3437 testFile = '/my/project/bin/test.dart'; | 3443 testFile = '/my/project/bin/test.dart'; |
3438 addLibrarySource('/a.dart', 'class C {}'); | 3444 addLibrarySource('/a.dart', 'class C {}'); |
3439 checkLibrary('import "/a.dart"; C c;'); | 3445 checkLibrary('import "/a.dart"; C c;'); |
3440 } | 3446 } |
3441 | 3447 |
3442 test_import_show() { | 3448 test_import_show() { |
3443 addLibrary('dart:async'); | 3449 addLibrary('dart:async'); |
3444 checkLibrary(''' | 3450 checkLibrary(''' |
3445 import "dart:async" show Future, Stream; | 3451 import "dart:async" show Future, Stream; |
3446 Future f; | 3452 Future f; |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4742 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4748 fail('Unexpectedly tried to get unlinked summary for $uri'); |
4743 } | 4749 } |
4744 return serializedUnit; | 4750 return serializedUnit; |
4745 } | 4751 } |
4746 | 4752 |
4747 @override | 4753 @override |
4748 bool hasLibrarySummary(String uri) { | 4754 bool hasLibrarySummary(String uri) { |
4749 return true; | 4755 return true; |
4750 } | 4756 } |
4751 } | 4757 } |
OLD | NEW |