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 d.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 '../descriptor.dart' as d; | 5 import '../descriptor.dart' as d; |
8 import '../test_pub.dart'; | 6 import '../test_pub.dart'; |
9 import 'utils.dart'; | 7 import 'utils.dart'; |
10 | 8 |
11 main() { | 9 main() { |
12 integration("'packages' URLs look in the app's lib directory", () { | 10 integration("'packages' URLs look in the app's lib directory", () { |
13 d.dir(appPath, [ | 11 d.dir(appPath, [ |
14 d.appPubspec(), | 12 d.appPubspec(), |
15 d.dir("lib", [ | 13 d.dir("lib", [ |
16 d.file("lib.dart", "foo() => 'foo';"), | 14 d.file("lib.dart", "foo() => 'foo';"), |
17 d.dir("sub", [ | 15 d.dir("sub", [ |
18 d.file("lib.dart", "bar() => 'bar';"), | 16 d.file("lib.dart", "bar() => 'bar';"), |
19 ]) | 17 ]) |
20 ]) | 18 ]) |
21 ]).create(); | 19 ]).create(); |
22 | 20 |
23 pubGet(); | 21 pubGet(); |
24 pubServe(); | 22 pubServe(); |
25 requestShouldSucceed("packages/myapp/lib.dart", "foo() => 'foo';"); | 23 requestShouldSucceed("packages/myapp/lib.dart", "foo() => 'foo';"); |
26 requestShouldSucceed("packages/myapp/sub/lib.dart", "bar() => 'bar';"); | 24 requestShouldSucceed("packages/myapp/sub/lib.dart", "bar() => 'bar';"); |
27 | 25 |
28 // "packages" can be in a subpath of the URL: | 26 // "packages" can be in a subpath of the URL: |
29 requestShouldSucceed("foo/packages/myapp/lib.dart", "foo() => 'foo';"); | 27 requestShouldSucceed("foo/packages/myapp/lib.dart", "foo() => 'foo';"); |
30 requestShouldSucceed("a/b/packages/myapp/sub/lib.dart", "bar() => 'bar';"); | 28 requestShouldSucceed("a/b/packages/myapp/sub/lib.dart", "bar() => 'bar';"); |
31 endPubServe(); | 29 endPubServe(); |
32 }); | 30 }); |
33 } | 31 } |
OLD | NEW |