Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: sdk/lib/_internal/pub/test/get/path/relative_path_test.dart

Issue 34803006: Make pubspec.lock keep relative path if it is originally specified as relative in pubspec.yaml (iss… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve code according to the code review comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 d.file. 3 // BSD-style license that can be found in the LICENSE d.file.
4 4
5 import 'package:path/path.dart' as path;
6 import 'package:scheduled_test/scheduled_test.dart';
7 import 'package:unittest/unittest.dart';
8
9 import '../../../lib/src/lock_file.dart';
10 import '../../../lib/src/source_registry.dart';
5 import '../../descriptor.dart' as d; 11 import '../../descriptor.dart' as d;
6 import '../../test_pub.dart'; 12 import '../../test_pub.dart';
7 13
8 main() { 14 main() {
9 initConfig(); 15 initConfig();
10 integration("can use relative path", () { 16 integration("can use relative path", () {
11 d.dir("foo", [ 17 d.dir("foo", [
12 d.libDir("foo"), 18 d.libDir("foo"),
13 d.libPubspec("foo", "0.0.1") 19 d.libPubspec("foo", "0.0.1")
14 ]).create(); 20 ]).create();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 58
53 d.dir(packagesPath, [ 59 d.dir(packagesPath, [
54 d.dir("foo", [ 60 d.dir("foo", [
55 d.file("foo.dart", 'main() => "foo";') 61 d.file("foo.dart", 'main() => "foo";')
56 ]), 62 ]),
57 d.dir("bar", [ 63 d.dir("bar", [
58 d.file("bar.dart", 'main() => "bar";') 64 d.file("bar.dart", 'main() => "bar";')
59 ]) 65 ])
60 ]).validate(); 66 ]).validate();
61 }); 67 });
68
69 integration("relative path preserved in the lockfile", () {
70 d.dir("foo", [
71 d.libDir("foo"),
72 d.libPubspec("foo", "0.0.1")
73 ]).create();
74
75 d.dir(appPath, [
76 d.appPubspec({
77 "foo": {"path": "../foo"}
78 })
79 ]).create();
80
81 pubGet();
82
83 schedule(() {
84 var lockfilePath = path.join(sandboxDir, appPath, "pubspec.lock");
85 var lockfile = new LockFile.load(lockfilePath, new SourceRegistry());
86 var description = lockfile.packages["foo"].description;
87
88 expect(path.isRelative(description["path"]), isTrue);
89 });
90 });
62 } 91 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/source/path.dart ('k') | sdk/lib/_internal/pub/test/lock_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698