Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 2f84d68

Browse files
committed
1 parent d966a6c commit 2f84d68

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ environment:
77
sdk: '>=1.0.0 <2.0.0'
88
dependencies:
99
which: '>=0.1.2 <0.2.0'
10+
dev_dependencies:
11+
unittest: '>=0.11.0 <0.12.0'

test/cli_util_test.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:cli_util/cli_util.dart';
6+
import 'package:unittest/unittest.dart';
7+
8+
void defineTests() {
9+
group('getSdkDir', () {
10+
test('arg parsing', () {
11+
expect(getSdkDir(['--dart-sdk', '/dart/sdk']).path, equals('/dart/sdk'));
12+
expect(getSdkDir(['--dart-sdk=/dart/sdk']).path, equals('/dart/sdk'));
13+
});
14+
});
15+
}
16+
17+
main() {
18+
groupSep = ' | ';
19+
20+
defineTests();
21+
}

tool/travis.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ set -e
99

1010
# Verify that the libraries are error free.
1111
dartanalyzer --fatal-warnings \
12-
lib/cli_util.dart
12+
lib/cli_util.dart \
13+
test/cli_util_test.dart
1314

1415
# Run the tests.
15-
#dart test/all.dart
16+
dart test/cli_util_test.dart
1617

1718
# Install dart_coveralls; gather and send coverage data.
1819
if [ "$COVERALLS_TOKEN" ]; then
@@ -21,5 +22,5 @@ if [ "$COVERALLS_TOKEN" ]; then
2122
--token $COVERALLS_TOKEN \
2223
--retry 2 \
2324
--exclude-test-files \
24-
test/all.dart
25+
test/cli_util_test.dart
2526
fi

0 commit comments

Comments
 (0)