OLD | NEW |
(Empty) | |
| 1 library pub_tests; |
| 2 import '../../descriptor.dart' as d; |
| 3 import '../../test_pub.dart'; |
| 4 main() { |
| 5 initConfig(); |
| 6 integration('reinstalls previously cached hosted packages', () { |
| 7 servePackages((builder) { |
| 8 builder.serve("foo", "1.2.3"); |
| 9 builder.serve("foo", "1.2.4"); |
| 10 builder.serve("foo", "1.2.5"); |
| 11 builder.serve("bar", "1.2.3"); |
| 12 builder.serve("bar", "1.2.4"); |
| 13 }); |
| 14 d.dir( |
| 15 cachePath, |
| 16 [ |
| 17 d.dir( |
| 18 'hosted', |
| 19 [ |
| 20 d.async( |
| 21 port.then( |
| 22 (p) => |
| 23 d.dir( |
| 24 'localhost%58$p', |
| 25 [ |
| 26 d.dir("foo-1.2.3", [d.libPubspec("foo",
"1.2.3"), d.file("broken.txt")]), |
| 27 d.dir("foo-1.2.5", [d.libPubspec("foo",
"1.2.5"), d.file("broken.txt")]), |
| 28 d.dir( |
| 29 "bar-1.2.4", |
| 30 [d.libPubspec("bar", "1.2.4"), d.fil
e("broken.txt")])])))])]).create(); |
| 31 schedulePub(args: ["cache", "repair"], output: ''' |
| 32 Downloading bar 1.2.4... |
| 33 Downloading foo 1.2.3... |
| 34 Downloading foo 1.2.5... |
| 35 Reinstalled 3 packages.'''); |
| 36 d.hostedCache( |
| 37 [ |
| 38 d.dir("bar-1.2.4", [d.nothing("broken.txt")]), |
| 39 d.dir("foo-1.2.3", [d.nothing("broken.txt")]), |
| 40 d.dir("foo-1.2.5", [d.nothing("broken.txt")])]).validate(); |
| 41 }); |
| 42 } |
OLD | NEW |