| 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 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 test("an annotation's structure is invalid", () { | 145 test("an annotation's structure is invalid", () { |
| 146 var testPath = p.join(_sandbox, "test.dart"); | 146 var testPath = p.join(_sandbox, "test.dart"); |
| 147 new File(testPath).writeAsStringSync("@TestOn()\nlibrary foo;"); | 147 new File(testPath).writeAsStringSync("@TestOn()\nlibrary foo;"); |
| 148 var result = _runUnittest(["test.dart"]); | 148 var result = _runUnittest(["test.dart"]); |
| 149 | 149 |
| 150 expect(result.stdout, allOf([ | 150 expect(result.stdout, allOf([ |
| 151 contains('-1: load error'), | 151 contains('-1: load error'), |
| 152 contains( | 152 contains( |
| 153 ' Failed to load "${p.relative(testPath, from: _sandbox)}":\n' | 153 ' Failed to load "${p.relative(testPath, from: _sandbox)}":\n' |
| 154 " Error on line 1, column 8: TestOn takes one argument.\n" | 154 " Error on line 1, column 8: TestOn takes 1 argument.\n" |
| 155 " @TestOn()\n" | 155 " @TestOn()\n" |
| 156 " ^^\n") | 156 " ^^\n") |
| 157 ])); | 157 ])); |
| 158 expect(result.exitCode, equals(1)); | 158 expect(result.exitCode, equals(1)); |
| 159 }); | 159 }); |
| 160 | 160 |
| 161 test("an annotation's contents are invalid", () { | 161 test("an annotation's contents are invalid", () { |
| 162 var testPath = p.join(_sandbox, "test.dart"); | 162 var testPath = p.join(_sandbox, "test.dart"); |
| 163 new File(testPath).writeAsStringSync("@TestOn('zim')\nlibrary foo;"); | 163 new File(testPath).writeAsStringSync("@TestOn('zim')\nlibrary foo;"); |
| 164 var result = _runUnittest(["test.dart"]); | 164 var result = _runUnittest(["test.dart"]); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 }); | 488 }); |
| 489 }); | 489 }); |
| 490 }); | 490 }); |
| 491 } | 491 } |
| 492 | 492 |
| 493 ProcessResult _runUnittest(List<String> args) => | 493 ProcessResult _runUnittest(List<String> args) => |
| 494 runUnittest(args, workingDirectory: _sandbox); | 494 runUnittest(args, workingDirectory: _sandbox); |
| 495 | 495 |
| 496 ProcessResult _runDart(List<String> args) => | 496 ProcessResult _runDart(List<String> args) => |
| 497 runDart(args, workingDirectory: _sandbox); | 497 runDart(args, workingDirectory: _sandbox); |
| OLD | NEW |