| 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; | |
| 6 | |
| 7 import 'package:path/path.dart' as p; | 5 import 'package:path/path.dart' as p; |
| 8 import 'package:scheduled_test/scheduled_test.dart'; | 6 import 'package:scheduled_test/scheduled_test.dart'; |
| 9 | 7 |
| 10 import '../descriptor.dart' as d; | 8 import '../descriptor.dart' as d; |
| 11 import '../test_pub.dart'; | 9 import '../test_pub.dart'; |
| 12 | 10 |
| 13 main() { | 11 main() { |
| 14 integration("doesn't recreate a snapshot when no dependencies of a package " | 12 integration("doesn't recreate a snapshot when no dependencies of a package " |
| 15 "have changed", () { | 13 "have changed", () { |
| 16 servePackages((builder) { | 14 servePackages((builder) { |
| 17 builder.serve("foo", "1.2.3", deps: {"bar": "any"}, contents: [ | 15 builder.serve("foo", "1.2.3", deps: {"bar": "any"}, contents: [ |
| 18 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!');")]) | 16 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!');")]) |
| 19 ]); | 17 ]); |
| 20 builder.serve("bar", "1.2.3"); | 18 builder.serve("bar", "1.2.3"); |
| 21 }); | 19 }); |
| 22 | 20 |
| 23 d.appDir({"foo": "1.2.3"}).create(); | 21 d.appDir({"foo": "1.2.3"}).create(); |
| 24 | 22 |
| 25 pubGet(output: contains("Precompiled foo:hello.")); | 23 pubGet(output: contains("Precompiled foo:hello.")); |
| 26 | 24 |
| 27 pubUpgrade(output: isNot(contains("Precompiled foo:hello."))); | 25 pubUpgrade(output: isNot(contains("Precompiled foo:hello."))); |
| 28 | 26 |
| 29 d.dir(p.join(appPath, '.pub', 'bin'), [ | 27 d.dir(p.join(appPath, '.pub', 'bin'), [ |
| 30 d.file('sdk-version', '0.1.2+3\n'), | 28 d.file('sdk-version', '0.1.2+3\n'), |
| 31 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) | 29 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) |
| 32 ]).validate(); | 30 ]).validate(); |
| 33 }); | 31 }); |
| 34 } | 32 } |
| OLD | NEW |