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 import 'dart:io'; |
| 6 |
5 import 'package:cli_util/cli_util.dart'; | 7 import 'package:cli_util/cli_util.dart'; |
6 import 'package:unittest/unittest.dart'; | 8 import 'package:cli_util/src/utils.dart'; |
| 9 import 'package:test/test.dart'; |
| 10 |
| 11 main() => defineTests(); |
7 | 12 |
8 void defineTests() { | 13 void defineTests() { |
9 group('getSdkDir', () { | 14 group('getSdkDir', () { |
10 test('arg parsing', () { | 15 test('arg parsing', () { |
| 16 // ignore: deprecated_member_use |
11 expect(getSdkDir(['--dart-sdk', '/dart/sdk']).path, equals('/dart/sdk')); | 17 expect(getSdkDir(['--dart-sdk', '/dart/sdk']).path, equals('/dart/sdk')); |
| 18 // ignore: deprecated_member_use |
12 expect(getSdkDir(['--dart-sdk=/dart/sdk']).path, equals('/dart/sdk')); | 19 expect(getSdkDir(['--dart-sdk=/dart/sdk']).path, equals('/dart/sdk')); |
13 }); | 20 }); |
| 21 |
| 22 test('finds the SDK without cli args', () { |
| 23 // ignore: deprecated_member_use |
| 24 expect(getSdkDir(), isNotNull); |
| 25 }); |
| 26 }); |
| 27 |
| 28 group('getSdkPath', () { |
| 29 test('sdkPath', () { |
| 30 expect(getSdkPath(), isNotNull); |
| 31 }); |
| 32 }); |
| 33 |
| 34 group('utils', () { |
| 35 test('isSdkDir', () { |
| 36 expect(isSdkDir(new Directory(getSdkPath())), true); |
| 37 }); |
14 }); | 38 }); |
15 } | 39 } |
16 | |
17 main() { | |
18 groupSep = ' | '; | |
19 | |
20 defineTests(); | |
21 } | |
OLD | NEW |