OLD | NEW |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 import 'package:scheduled_test/scheduled_test.dart'; | 1 import 'package:scheduled_test/scheduled_test.dart'; |
6 | |
7 import 'descriptor.dart' as d; | 2 import 'descriptor.dart' as d; |
8 import 'test_pub.dart'; | 3 import 'test_pub.dart'; |
9 | |
10 main() { | 4 main() { |
11 initConfig(); | 5 initConfig(); |
12 | |
13 setUp(() { | 6 setUp(() { |
14 servePackages((builder) { | 7 servePackages((builder) { |
15 builder.serve("normal", "1.2.3", deps: { | 8 builder.serve("normal", "1.2.3", deps: { |
16 "transitive": "any", | 9 "transitive": "any", |
17 "circular_a": "any" | 10 "circular_a": "any" |
18 }); | 11 }); |
19 builder.serve("transitive", "1.2.3", deps: {"shared": "any"}); | 12 builder.serve("transitive", "1.2.3", deps: { |
20 builder.serve("shared", "1.2.3", deps: {"other": "any"}); | 13 "shared": "any" |
21 builder.serve("unittest", "1.2.3", deps: {"shared": "any"}); | 14 }); |
| 15 builder.serve("shared", "1.2.3", deps: { |
| 16 "other": "any" |
| 17 }); |
| 18 builder.serve("unittest", "1.2.3", deps: { |
| 19 "shared": "any" |
| 20 }); |
22 builder.serve("other", "1.0.0"); | 21 builder.serve("other", "1.0.0"); |
23 builder.serve("overridden", "1.0.0"); | 22 builder.serve("overridden", "1.0.0"); |
24 builder.serve("overridden", "2.0.0"); | 23 builder.serve("overridden", "2.0.0"); |
25 builder.serve("override_only", "1.2.3"); | 24 builder.serve("override_only", "1.2.3"); |
26 builder.serve("circular_a", "1.2.3", deps: {"circular_b": "any"}); | 25 builder.serve("circular_a", "1.2.3", deps: { |
27 builder.serve("circular_b", "1.2.3", deps: {"circular_a": "any"}); | 26 "circular_b": "any" |
| 27 }); |
| 28 builder.serve("circular_b", "1.2.3", deps: { |
| 29 "circular_a": "any" |
| 30 }); |
28 }); | 31 }); |
29 | 32 d.dir( |
30 d.dir("from_path", [ | 33 "from_path", |
31 d.libDir("from_path"), | 34 [d.libDir("from_path"), d.libPubspec("from_path", "1.2.3")]).create(); |
32 d.libPubspec("from_path", "1.2.3") | 35 d.dir(appPath, [d.pubspec({ |
33 ]).create(); | |
34 | |
35 d.dir(appPath, [ | |
36 d.pubspec({ | |
37 "name": "myapp", | 36 "name": "myapp", |
38 "dependencies": { | 37 "dependencies": { |
39 "normal": "any", | 38 "normal": "any", |
40 "overridden": "1.0.0", | 39 "overridden": "1.0.0", |
41 "from_path": {"path": "../from_path"} | 40 "from_path": { |
| 41 "path": "../from_path" |
| 42 } |
42 }, | 43 }, |
43 "dev_dependencies": { | 44 "dev_dependencies": { |
44 "unittest": "any" | 45 "unittest": "any" |
45 }, | 46 }, |
46 "dependency_overrides": { | 47 "dependency_overrides": { |
47 "overridden": "2.0.0", | 48 "overridden": "2.0.0", |
48 "override_only": "any" | 49 "override_only": "any" |
49 } | 50 } |
50 }) | 51 })]).create(); |
51 ]).create(); | |
52 }); | 52 }); |
53 | |
54 integration("lists dependencies in compact form", () { | 53 integration("lists dependencies in compact form", () { |
55 pubGet(); | 54 pubGet(); |
56 schedulePub(args: ['deps', '-s', 'compact'], output: ''' | 55 schedulePub(args: ['deps', '-s', 'compact'], output: ''' |
57 myapp 0.0.0 | 56 myapp 0.0.0 |
58 | 57 |
59 dependencies: | 58 dependencies: |
60 - from_path 1.2.3 | 59 - from_path 1.2.3 |
61 - normal 1.2.3 [transitive circular_a] | 60 - normal 1.2.3 [transitive circular_a] |
62 - overridden 2.0.0 | 61 - overridden 2.0.0 |
63 | 62 |
64 dev dependencies: | 63 dev dependencies: |
65 - unittest 1.2.3 [shared] | 64 - unittest 1.2.3 [shared] |
66 | 65 |
67 dependency overrides: | 66 dependency overrides: |
68 - overridden 2.0.0 | 67 - overridden 2.0.0 |
69 - override_only 1.2.3 | 68 - override_only 1.2.3 |
70 | 69 |
71 transitive dependencies: | 70 transitive dependencies: |
72 - circular_a 1.2.3 [circular_b] | 71 - circular_a 1.2.3 [circular_b] |
73 - circular_b 1.2.3 [circular_a] | 72 - circular_b 1.2.3 [circular_a] |
74 - other 1.0.0 | 73 - other 1.0.0 |
75 - shared 1.2.3 [other] | 74 - shared 1.2.3 [other] |
76 - transitive 1.2.3 [shared] | 75 - transitive 1.2.3 [shared] |
77 '''); | 76 '''); |
78 }); | 77 }); |
79 | |
80 integration("lists dependencies in list form", () { | 78 integration("lists dependencies in list form", () { |
81 pubGet(); | 79 pubGet(); |
82 schedulePub(args: ['deps', '--style', 'list'], output: ''' | 80 schedulePub(args: ['deps', '--style', 'list'], output: ''' |
83 myapp 0.0.0 | 81 myapp 0.0.0 |
84 | 82 |
85 dependencies: | 83 dependencies: |
86 - from_path 1.2.3 | 84 - from_path 1.2.3 |
87 - normal 1.2.3 | 85 - normal 1.2.3 |
88 - transitive any | 86 - transitive any |
89 - circular_a any | 87 - circular_a any |
(...skipping 12 matching lines...) Expand all Loading... |
102 - circular_b any | 100 - circular_b any |
103 - circular_b 1.2.3 | 101 - circular_b 1.2.3 |
104 - circular_a any | 102 - circular_a any |
105 - other 1.0.0 | 103 - other 1.0.0 |
106 - shared 1.2.3 | 104 - shared 1.2.3 |
107 - other any | 105 - other any |
108 - transitive 1.2.3 | 106 - transitive 1.2.3 |
109 - shared any | 107 - shared any |
110 '''); | 108 '''); |
111 }); | 109 }); |
112 | |
113 integration("lists dependencies in tree form", () { | 110 integration("lists dependencies in tree form", () { |
114 pubGet(); | 111 pubGet(); |
115 schedulePub(args: ['deps'], output: ''' | 112 schedulePub(args: ['deps'], output: ''' |
116 myapp 0.0.0 | 113 myapp 0.0.0 |
117 |-- from_path 1.2.3 | 114 |-- from_path 1.2.3 |
118 |-- normal 1.2.3 | 115 |-- normal 1.2.3 |
119 | |-- circular_a 1.2.3 | 116 | |-- circular_a 1.2.3 |
120 | | '-- circular_b 1.2.3 | 117 | | '-- circular_b 1.2.3 |
121 | | '-- circular_a... | 118 | | '-- circular_a... |
122 | '-- transitive 1.2.3 | 119 | '-- transitive 1.2.3 |
123 | '-- shared... | 120 | '-- shared... |
124 |-- overridden 2.0.0 | 121 |-- overridden 2.0.0 |
125 |-- override_only 1.2.3 | 122 |-- override_only 1.2.3 |
126 '-- unittest 1.2.3 | 123 '-- unittest 1.2.3 |
127 '-- shared 1.2.3 | 124 '-- shared 1.2.3 |
128 '-- other 1.0.0 | 125 '-- other 1.0.0 |
129 '''); | 126 '''); |
130 }); | 127 }); |
131 } | 128 } |
OLD | NEW |