OLD | NEW |
| (Empty) |
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'; | |
6 | |
7 import 'package:path/path.dart' as path; | |
8 | |
9 import '../descriptor.dart' as d; | |
10 import '../test_pub.dart'; | |
11 | |
12 main() { | |
13 initConfig(); | |
14 | |
15 // This is a regression test for dartbug.com/14442. | |
16 // | |
17 // If you have a long chain of path dependencies with long relative paths, | |
18 // you can end up with a combined path that is longer than the OS can handle. | |
19 // For example, the path that revealed this bug was: | |
20 // | |
21 // C:\jenkins-slave\workspace\mSEE-Dev\ozone\dart\portfolio-manager\src\main\ | |
22 // portfolio-manager\..\..\..\..\portfolio-common\src\main\portfolio-common\ | |
23 // ../../../../dart-visualization/src/main/dart-visualization\lib\src\vega\ | |
24 // data\transform\visual | |
25 // | |
26 // This test ensures that we're normalizing at some point before we throw the | |
27 // path at the OS to choke on. | |
28 | |
29 integration("handles long relative paths", () { | |
30 // Dart2js can take a long time to compile dart code, so we increase the | |
31 // timeout to cope with that. | |
32 currentSchedule.timeout *= 3; | |
33 | |
34 d.dir( | |
35 "some_long_dependency_name", | |
36 [ | |
37 d.libPubspec("foo", "0.0.1"), | |
38 d.dir("lib", [d.file("foo.txt", "foo")])]).create(); | |
39 | |
40 // Build a 2,800 character (non-canonicalized) path. | |
41 var longPath = ""; | |
42 for (var i = 0; i < 100; i++) { | |
43 longPath = path.join(longPath, "..", "some_long_dependency_name"); | |
44 } | |
45 | |
46 d.dir(appPath, [d.appPubspec({ | |
47 "foo": { | |
48 "path": longPath | |
49 } | |
50 }), d.dir("web", [d.file("index.html", "html"),])]).create(); | |
51 | |
52 schedulePub( | |
53 args: ["build"], | |
54 output: new RegExp(r'Built 2 files to "build".')); | |
55 | |
56 d.dir( | |
57 appPath, | |
58 [ | |
59 d.dir( | |
60 'build', | |
61 [ | |
62 d.dir( | |
63 'web', | |
64 [ | |
65 d.file("index.html", "html"), | |
66 d.dir('packages', [d.dir('foo', [d.file('foo.txt', '
foo')])])])])]).validate(); | |
67 }); | |
68 } | |
OLD | NEW |