OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
11 import '../test_pub.dart'; | 11 import '../test_pub.dart'; |
12 | 12 |
13 const BROKEN_TRANSFORMER = """ | 13 const BROKEN_TRANSFORMER = """ |
14 import 'dart:async'; | 14 import 'dart:async'; |
15 | 15 |
16 import 'package:barback/barback.dart'; | 16 import 'package:barback/barback.dart'; |
17 | 17 |
18 class BrokenTransformer extends Transformer { | 18 class BrokenTransformer extends Transformer { |
19 BrokenTransformer.asPlugin(); | 19 BrokenTransformer.asPlugin(); |
20 | 20 |
21 // This file intentionally has a syntax error so that any attempt to load it | 21 // This file intentionally has a syntax error so that any attempt to load it |
22 // will crash. | 22 // will crash. |
23 """; | 23 """; |
24 | 24 |
25 main() { | 25 main() { |
26 initConfig(); | |
27 | |
28 // Regression test for issue 20917. | 26 // Regression test for issue 20917. |
29 integration("snapshots the transformed version of an executable", () { | 27 integration("snapshots the transformed version of an executable", () { |
30 servePackages((builder) { | 28 servePackages((builder) { |
31 builder.serveRepoPackage('barback'); | 29 builder.serveRepoPackage('barback'); |
32 | 30 |
33 builder.serve("foo", "1.2.3", | 31 builder.serve("foo", "1.2.3", |
34 contents: [ | 32 contents: [ |
35 d.dir("bin", [ | 33 d.dir("bin", [ |
36 d.file("hello.dart", "void main() => print('hello!');") | 34 d.file("hello.dart", "void main() => print('hello!');") |
37 ]) | 35 ]) |
(...skipping 18 matching lines...) Expand all Loading... |
56 | 54 |
57 d.dir(p.join(appPath, '.pub', 'bin'), [ | 55 d.dir(p.join(appPath, '.pub', 'bin'), [ |
58 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) | 56 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) |
59 ]).validate(); | 57 ]).validate(); |
60 | 58 |
61 var process = pubRun(args: ['foo:hello']); | 59 var process = pubRun(args: ['foo:hello']); |
62 process.stdout.expect("hello!"); | 60 process.stdout.expect("hello!"); |
63 process.shouldExit(); | 61 process.shouldExit(); |
64 }); | 62 }); |
65 } | 63 } |
OLD | NEW |