OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
8 | 8 |
9 import '../descriptor.dart' as d; | 9 import '../descriptor.dart' as d; |
10 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 // data\transform\visual | 24 // data\transform\visual |
25 // | 25 // |
26 // This test ensures that we're normalizing at some point before we throw the | 26 // This test ensures that we're normalizing at some point before we throw the |
27 // path at the OS to choke on. | 27 // path at the OS to choke on. |
28 | 28 |
29 integration("handles long relative paths", () { | 29 integration("handles long relative paths", () { |
30 // Dart2js can take a long time to compile dart code, so we increase the | 30 // Dart2js can take a long time to compile dart code, so we increase the |
31 // timeout to cope with that. | 31 // timeout to cope with that. |
32 currentSchedule.timeout *= 3; | 32 currentSchedule.timeout *= 3; |
33 | 33 |
34 d.dir("some_long_dependency_name", [ | 34 d.dir( |
35 d.libPubspec("foo", "0.0.1"), | 35 "some_long_dependency_name", |
36 d.dir("lib", [ | 36 [ |
37 d.file("foo.txt", "foo") | 37 d.libPubspec("foo", "0.0.1"), |
38 ]) | 38 d.dir("lib", [d.file("foo.txt", "foo")])]).create(); |
39 ]).create(); | |
40 | 39 |
41 // Build a 2,800 character (non-canonicalized) path. | 40 // Build a 2,800 character (non-canonicalized) path. |
42 var longPath = ""; | 41 var longPath = ""; |
43 for (var i = 0; i < 100; i++) | 42 for (var i = 0; i < 100; i++) { |
44 { | |
45 longPath = path.join(longPath, "..", "some_long_dependency_name"); | 43 longPath = path.join(longPath, "..", "some_long_dependency_name"); |
46 } | 44 } |
47 | 45 |
48 d.dir(appPath, [ | 46 d.dir(appPath, [d.appPubspec({ |
49 d.appPubspec({ | 47 "foo": { |
50 "foo": {"path": longPath} | 48 "path": longPath |
51 }), | 49 } |
52 d.dir("web", [ | 50 }), d.dir("web", [d.file("index.html", "html"),])]).create(); |
53 d.file("index.html", "html"), | |
54 ]) | |
55 ]).create(); | |
56 | 51 |
57 schedulePub(args: ["build"], | 52 schedulePub( |
| 53 args: ["build"], |
58 output: new RegExp(r'Built 2 files to "build".')); | 54 output: new RegExp(r'Built 2 files to "build".')); |
59 | 55 |
60 d.dir(appPath, [ | 56 d.dir( |
61 d.dir('build', [ | 57 appPath, |
62 d.dir('web', [ | 58 [ |
63 d.file("index.html", "html"), | 59 d.dir( |
64 d.dir('packages', [ | 60 'build', |
65 d.dir('foo', [ | 61 [ |
66 d.file('foo.txt', 'foo') | 62 d.dir( |
67 ]) | 63 'web', |
68 ]) | 64 [ |
69 ]) | 65 d.file("index.html", "html"), |
70 ]) | 66 d.dir('packages', [d.dir('foo', [d.file('foo.txt', '
foo')])])])])]).validate(); |
71 ]).validate(); | |
72 }); | 67 }); |
73 } | 68 } |
OLD | NEW |