| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, 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 d.file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import '../../../../../pkg/pathos/lib/path.dart' as path; | 5 import '../../../../../pkg/pathos/lib/path.dart' as path; |
| 6 | 6 |
| 7 import '../../descriptor.dart' as d; | |
| 8 import '../../test_pub.dart'; | 7 import '../../test_pub.dart'; |
| 9 | 8 |
| 10 main() { | 9 main() { |
| 11 initConfig(); | 10 initConfig(); |
| 12 integration("shared dependency with same path", () { | 11 integration("shared dependency with same path", () { |
| 13 d.dir("shared", [ | 12 dir("shared", [ |
| 14 d.libDir("shared"), | 13 libDir("shared"), |
| 15 d.libPubspec("shared", "0.0.1") | 14 libPubspec("shared", "0.0.1") |
| 16 ]).create(); | 15 ]).scheduleCreate(); |
| 17 | 16 |
| 18 d.dir("foo", [ | 17 dir("foo", [ |
| 19 d.libDir("foo"), | 18 libDir("foo"), |
| 20 d.libPubspec("foo", "0.0.1", deps: [ | 19 libPubspec("foo", "0.0.1", deps: [ |
| 21 {"path": "../shared"} | 20 {"path": "../shared"} |
| 22 ]) | 21 ]) |
| 23 ]).create(); | 22 ]).scheduleCreate(); |
| 24 | 23 |
| 25 d.dir("bar", [ | 24 dir("bar", [ |
| 26 d.libDir("bar"), | 25 libDir("bar"), |
| 27 d.libPubspec("bar", "0.0.1", deps: [ | 26 libPubspec("bar", "0.0.1", deps: [ |
| 28 {"path": "../shared"} | 27 {"path": "../shared"} |
| 29 ]) | 28 ]) |
| 30 ]).create(); | 29 ]).scheduleCreate(); |
| 31 | 30 |
| 32 d.dir(appPath, [ | 31 dir(appPath, [ |
| 33 d.pubspec({ | 32 pubspec({ |
| 34 "name": "myapp", | 33 "name": "myapp", |
| 35 "dependencies": { | 34 "dependencies": { |
| 36 "foo": {"path": "../foo"}, | 35 "foo": {"path": "../foo"}, |
| 37 "bar": {"path": "../bar"} | 36 "bar": {"path": "../bar"} |
| 38 } | 37 } |
| 39 }) | 38 }) |
| 40 ]).create(); | 39 ]).scheduleCreate(); |
| 41 | 40 |
| 42 schedulePub(args: ["install"], | 41 schedulePub(args: ["install"], |
| 43 output: new RegExp(r"Dependencies installed!$")); | 42 output: new RegExp(r"Dependencies installed!$")); |
| 44 | 43 |
| 45 d.dir(packagesPath, [ | 44 dir(packagesPath, [ |
| 46 d.dir("foo", [d.file("foo.dart", 'main() => "foo";')]), | 45 dir("foo", [file("foo.dart", 'main() => "foo";')]), |
| 47 d.dir("bar", [d.file("bar.dart", 'main() => "bar";')]), | 46 dir("bar", [file("bar.dart", 'main() => "bar";')]), |
| 48 d.dir("shared", [d.file("shared.dart", 'main() => "shared";')]) | 47 dir("shared", [file("shared.dart", 'main() => "shared";')]) |
| 49 ]).validate(); | 48 ]).scheduleValidate(); |
| 50 }); | 49 }); |
| 51 | 50 |
| 52 integration("shared dependency with paths that normalize the same", () { | 51 integration("shared dependency with paths that normalize the same", () { |
| 53 d.dir("shared", [ | 52 dir("shared", [ |
| 54 d.libDir("shared"), | 53 libDir("shared"), |
| 55 d.libPubspec("shared", "0.0.1") | 54 libPubspec("shared", "0.0.1") |
| 56 ]).create(); | 55 ]).scheduleCreate(); |
| 57 | 56 |
| 58 d.dir("foo", [ | 57 dir("foo", [ |
| 59 d.libDir("foo"), | 58 libDir("foo"), |
| 60 d.libPubspec("foo", "0.0.1", deps: [ | 59 libPubspec("foo", "0.0.1", deps: [ |
| 61 {"path": "../shared"} | 60 {"path": "../shared"} |
| 62 ]) | 61 ]) |
| 63 ]).create(); | 62 ]).scheduleCreate(); |
| 64 | 63 |
| 65 d.dir("bar", [ | 64 dir("bar", [ |
| 66 d.libDir("bar"), | 65 libDir("bar"), |
| 67 d.libPubspec("bar", "0.0.1", deps: [ | 66 libPubspec("bar", "0.0.1", deps: [ |
| 68 {"path": "../././shared"} | 67 {"path": "../././shared"} |
| 69 ]) | 68 ]) |
| 70 ]).create(); | 69 ]).scheduleCreate(); |
| 71 | 70 |
| 72 d.dir(appPath, [ | 71 dir(appPath, [ |
| 73 d.pubspec({ | 72 pubspec({ |
| 74 "name": "myapp", | 73 "name": "myapp", |
| 75 "dependencies": { | 74 "dependencies": { |
| 76 "foo": {"path": "../foo"}, | 75 "foo": {"path": "../foo"}, |
| 77 "bar": {"path": "../bar"} | 76 "bar": {"path": "../bar"} |
| 78 } | 77 } |
| 79 }) | 78 }) |
| 80 ]).create(); | 79 ]).scheduleCreate(); |
| 81 | 80 |
| 82 schedulePub(args: ["install"], | 81 schedulePub(args: ["install"], |
| 83 output: new RegExp(r"Dependencies installed!$")); | 82 output: new RegExp(r"Dependencies installed!$")); |
| 84 | 83 |
| 85 d.dir(packagesPath, [ | 84 dir(packagesPath, [ |
| 86 d.dir("foo", [d.file("foo.dart", 'main() => "foo";')]), | 85 dir("foo", [file("foo.dart", 'main() => "foo";')]), |
| 87 d.dir("bar", [d.file("bar.dart", 'main() => "bar";')]), | 86 dir("bar", [file("bar.dart", 'main() => "bar";')]), |
| 88 d.dir("shared", [d.file("shared.dart", 'main() => "shared";')]) | 87 dir("shared", [file("shared.dart", 'main() => "shared";')]) |
| 89 ]).validate(); | 88 ]).scheduleValidate(); |
| 90 }); | 89 }); |
| 91 | 90 |
| 92 integration("shared dependency with absolute and relative path", () { | 91 integration("shared dependency with absolute and relative path", () { |
| 93 d.dir("shared", [ | 92 dir("shared", [ |
| 94 d.libDir("shared"), | 93 libDir("shared"), |
| 95 d.libPubspec("shared", "0.0.1") | 94 libPubspec("shared", "0.0.1") |
| 96 ]).create(); | 95 ]).scheduleCreate(); |
| 97 | 96 |
| 98 d.dir("foo", [ | 97 dir("foo", [ |
| 99 d.libDir("foo"), | 98 libDir("foo"), |
| 100 d.libPubspec("foo", "0.0.1", deps: [ | 99 libPubspec("foo", "0.0.1", deps: [ |
| 101 {"path": "../shared"} | 100 {"path": "../shared"} |
| 102 ]) | 101 ]) |
| 103 ]).create(); | 102 ]).scheduleCreate(); |
| 104 | 103 |
| 105 d.dir("bar", [ | 104 dir("bar", [ |
| 106 d.libDir("bar"), | 105 libDir("bar"), |
| 107 d.libPubspec("bar", "0.0.1", deps: [ | 106 libPubspec("bar", "0.0.1", deps: [ |
| 108 {"path": path.join(sandboxDir, "shared")} | 107 {"path": path.join(sandboxDir, "shared")} |
| 109 ]) | 108 ]) |
| 110 ]).create(); | 109 ]).scheduleCreate(); |
| 111 | 110 |
| 112 d.dir(appPath, [ | 111 dir(appPath, [ |
| 113 d.pubspec({ | 112 pubspec({ |
| 114 "name": "myapp", | 113 "name": "myapp", |
| 115 "dependencies": { | 114 "dependencies": { |
| 116 "foo": {"path": "../foo"}, | 115 "foo": {"path": "../foo"}, |
| 117 "bar": {"path": "../bar"} | 116 "bar": {"path": "../bar"} |
| 118 } | 117 } |
| 119 }) | 118 }) |
| 120 ]).create(); | 119 ]).scheduleCreate(); |
| 121 | 120 |
| 122 schedulePub(args: ["install"], | 121 schedulePub(args: ["install"], |
| 123 output: new RegExp(r"Dependencies installed!$")); | 122 output: new RegExp(r"Dependencies installed!$")); |
| 124 | 123 |
| 125 d.dir(packagesPath, [ | 124 dir(packagesPath, [ |
| 126 d.dir("foo", [d.file("foo.dart", 'main() => "foo";')]), | 125 dir("foo", [file("foo.dart", 'main() => "foo";')]), |
| 127 d.dir("bar", [d.file("bar.dart", 'main() => "bar";')]), | 126 dir("bar", [file("bar.dart", 'main() => "bar";')]), |
| 128 d.dir("shared", [d.file("shared.dart", 'main() => "shared";')]) | 127 dir("shared", [file("shared.dart", 'main() => "shared";')]) |
| 129 ]).validate(); | 128 ]).scheduleValidate(); |
| 130 }); | 129 }); |
| 131 } | 130 } |
| OLD | NEW |