| 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:test/src/util/io.dart'; | 10 import 'package:test/src/util/io.dart'; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 +0 -2: failure 3 | 58 +0 -2: failure 3 |
| 59 +0 -3: failure 3 | 59 +0 -3: failure 3 |
| 60 oh no | 60 oh no |
| 61 test.dart 8:33 main.<fn> | 61 test.dart 8:33 main.<fn> |
| 62 | 62 |
| 63 | 63 |
| 64 +0 -3: Some tests failed."""); | 64 +0 -3: Some tests failed."""); |
| 65 }); | 65 }); |
| 66 | 66 |
| 67 test("includes the full stack trace with --verbose-trace", () { |
| 68 return withTempDir((path) { |
| 69 new File(p.join(path, "test.dart")).writeAsStringSync(""" |
| 70 import 'dart:async'; |
| 71 |
| 72 import 'package:test/test.dart'; |
| 73 |
| 74 void main() { |
| 75 test("failure", () => throw "oh no"); |
| 76 } |
| 77 """); |
| 78 var result = runTest(["-r", "compact", "--verbose-trace", "test.dart"], |
| 79 workingDirectory: path); |
| 80 expect(result.stdout, contains("dart:isolate-patch")); |
| 81 }); |
| 82 }); |
| 83 |
| 67 test("runs failing tests along with successful tests", () { | 84 test("runs failing tests along with successful tests", () { |
| 68 _expectReport(""" | 85 _expectReport(""" |
| 69 test('failure 1', () => throw new TestFailure('oh no')); | 86 test('failure 1', () => throw new TestFailure('oh no')); |
| 70 test('success 1', () {}); | 87 test('success 1', () {}); |
| 71 test('failure 2', () => throw new TestFailure('oh no')); | 88 test('failure 2', () => throw new TestFailure('oh no')); |
| 72 test('success 2', () {});""", | 89 test('success 2', () {});""", |
| 73 """ | 90 """ |
| 74 +0: failure 1 | 91 +0: failure 1 |
| 75 +0 -1: failure 1 | 92 +0 -1: failure 1 |
| 76 oh no | 93 oh no |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // Un-indent the expected string. | 366 // Un-indent the expected string. |
| 350 var indentation = expected.indexOf(new RegExp("[^ ]")); | 367 var indentation = expected.indexOf(new RegExp("[^ ]")); |
| 351 expected = expected.split("\n").map((line) { | 368 expected = expected.split("\n").map((line) { |
| 352 if (line.isEmpty) return line; | 369 if (line.isEmpty) return line; |
| 353 return line.substring(indentation); | 370 return line.substring(indentation); |
| 354 }).join("\n"); | 371 }).join("\n"); |
| 355 | 372 |
| 356 expect(actual, equals(expected)); | 373 expect(actual, equals(expected)); |
| 357 }), completes); | 374 }), completes); |
| 358 } | 375 } |
| OLD | NEW |