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 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 import 'package:unittest/src/util/exit_codes.dart' as exit_codes; | 10 import 'package:test/src/util/exit_codes.dart' as exit_codes; |
11 import 'package:unittest/unittest.dart'; | 11 import 'package:test/test.dart'; |
12 | 12 |
13 import '../../io.dart'; | 13 import '../../io.dart'; |
14 | 14 |
15 String _sandbox; | 15 String _sandbox; |
16 | 16 |
17 void main() { | 17 void main() { |
18 setUp(() { | 18 setUp(() { |
19 _sandbox = Directory.systemTemp.createTempSync('unittest_').path; | 19 _sandbox = Directory.systemTemp.createTempSync('test_').path; |
20 }); | 20 }); |
21 | 21 |
22 tearDown(() { | 22 tearDown(() { |
23 new Directory(_sandbox).deleteSync(recursive: true); | 23 new Directory(_sandbox).deleteSync(recursive: true); |
24 }); | 24 }); |
25 | 25 |
26 test("doesn't intermingle warnings", () { | 26 test("doesn't intermingle warnings", () { |
27 // These files need trailing newlines to work around issue 22667. | 27 // These files need trailing newlines to work around issue 22667. |
28 var testPath1 = p.join(_sandbox, "test1.dart"); | 28 var testPath1 = p.join(_sandbox, "test1.dart"); |
29 new File(testPath1).writeAsStringSync("String main() => 12;\n"); | 29 new File(testPath1).writeAsStringSync("String main() => 12;\n"); |
(...skipping 22 matching lines...) Expand all Loading... |
52 new File(testPath).writeAsStringSync("String main() => 12;\n"); | 52 new File(testPath).writeAsStringSync("String main() => 12;\n"); |
53 | 53 |
54 var result = _runUnittest(["--color", "-p", "chrome", "test.dart"]); | 54 var result = _runUnittest(["--color", "-p", "chrome", "test.dart"]); |
55 expect(result.stdout, contains('\u001b[35m')); | 55 expect(result.stdout, contains('\u001b[35m')); |
56 expect(result.exitCode, equals(exit_codes.data)); | 56 expect(result.exitCode, equals(exit_codes.data)); |
57 }); | 57 }); |
58 } | 58 } |
59 | 59 |
60 ProcessResult _runUnittest(List<String> args) => | 60 ProcessResult _runUnittest(List<String> args) => |
61 runUnittest(args, workingDirectory: _sandbox); | 61 runUnittest(args, workingDirectory: _sandbox); |
OLD | NEW |