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 /// Test that sdk extensions are properly detected in various scenarios. | 5 /// Test that sdk extensions are properly detected in various scenarios. |
6 library analyzer_cli.test.sdk_ext; | 6 library analyzer_cli.test.sdk_ext; |
7 | 7 |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 10 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
(...skipping 22 matching lines...) Expand all Loading... |
33 }); | 33 }); |
34 tearDown(() { | 34 tearDown(() { |
35 outSink = savedOutSink; | 35 outSink = savedOutSink; |
36 errorSink = savedErrorSink; | 36 errorSink = savedErrorSink; |
37 exitCode = savedExitCode; | 37 exitCode = savedExitCode; |
38 exitHandler = savedExitHandler; | 38 exitHandler = savedExitHandler; |
39 }); | 39 }); |
40 | 40 |
41 test('.packages file specified', () async { | 41 test('.packages file specified', () async { |
42 String testDir = path.join(testDirectory, 'data', 'packages_file'); | 42 String testDir = path.join(testDirectory, 'data', 'packages_file'); |
43 Driver driver = new Driver(); | 43 Driver driver = new Driver(isTesting: true); |
44 await driver.start([ | 44 await driver.start([ |
45 '--packages', | 45 '--packages', |
46 path.join(testDir, '_packages'), | 46 path.join(testDir, '_packages'), |
47 path.join(testDir, 'sdk_ext_user.dart') | 47 path.join(testDir, 'sdk_ext_user.dart') |
48 ]); | 48 ]); |
49 | 49 |
50 DartSdk sdk = driver.sdk; | 50 DartSdk sdk = driver.sdk; |
51 expect(sdk, new isInstanceOf<FolderBasedDartSdk>()); | 51 expect(sdk, new isInstanceOf<FolderBasedDartSdk>()); |
52 expect((sdk as FolderBasedDartSdk).useSummary, isFalse); | 52 expect((sdk as FolderBasedDartSdk).useSummary, isFalse); |
53 | 53 |
54 expect(exitCode, 0); | 54 expect(exitCode, 0); |
55 }); | 55 }); |
56 }); | 56 }); |
57 } | 57 } |
OLD | NEW |