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

Unified Diff: utils/tests/pub/pub_test.dart

Issue 10704172: Hook in the version solver to pub install. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_test.dart
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
index 8d7f1cdc94c72acdf81965ba187c3ffaf064bf0d..272aefcc891f3f952ff50684d49791363f2e9370 100644
--- a/utils/tests/pub/pub_test.dart
+++ b/utils/tests/pub/pub_test.dart
@@ -90,8 +90,9 @@ listCommand() {
}
installCommand() {
- test('adds a dependent package', () {
+ test('checks out a package from the SDK', () {
dir(sdkPath, [
+ file('revision', '1234'),
dir('lib', [
dir('foo', [
file('foo.dart', 'main() => "foo";')
@@ -117,40 +118,6 @@ installCommand() {
run();
});
- test('adds a transitively dependent package', () {
- dir(sdkPath, [
- dir('lib', [
- dir('foo', [
- file('foo.dart', 'main() => "foo";'),
- file('pubspec.yaml', 'dependencies:\n bar:')
- ]),
- dir('bar', [
- file('bar.dart', 'main() => "bar";'),
- ])
- ])
- ]).scheduleCreate();
-
- dir(appPath, [
- file('pubspec.yaml', 'dependencies:\n foo:')
- ]).scheduleCreate();
-
- schedulePub(args: ['install'],
- output: '''
- Dependencies installed!
- ''');
-
- dir(packagesPath, [
- dir('foo', [
- file('foo.dart', 'main() => "foo";')
- ]),
- dir('bar', [
- file('bar.dart', 'main() => "bar";'),
- ])
- ]).scheduleValidate();
-
- run();
- });
-
test('checks out a package from Git', () {
withGit(() {
git('foo.git', [
@@ -480,6 +447,105 @@ dependencies:
run();
});
+
+ test('resolves version constraints from a pub server', () {
+ servePackages("localhost", 3123, [
+ '''
+name: foo
+version: 1.2.3
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: ">=2.0.0"
+''',
+ '''
+name: bar
+version: 2.3.4
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: "<3.0.0"
+''',
+ '{name: baz, version: 2.0.3}',
+ '{name: baz, version: 2.0.4}',
+ '{name: baz, version: 3.0.1}',
+ ]);
+
+ dir(appPath, [
+ file('pubspec.yaml', '''
+dependencies:
+ foo: {repo: {name: foo, url: http://localhost:3123}}
+ bar: {repo: {name: bar, url: http://localhost:3123}}
+''')
+ ]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp("Dependencies installed!\$"));
+
+ dir(cachePath, [
+ dir('repo', [
+ dir('localhost%583123', [
+ dir('foo-1.2.3', [
+ file('pubspec.yaml', '''
+name: foo
+version: 1.2.3
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: ">=2.0.0"
+'''),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ]),
+ dir('bar-2.3.4', [
+ file('pubspec.yaml', '''
+name: bar
+version: 2.3.4
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: "<3.0.0"
+'''),
+ file('bar.dart', 'main() => print("bar 2.3.4");')
+ ]),
+ dir('baz-2.0.4', [
+ file('pubspec.yaml', '{name: baz, version: 2.0.4}'),
+ file('baz.dart', 'main() => print("baz 2.0.4");')
+ ])
+ ])
+ ])
+ ]).scheduleValidate();
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('pubspec.yaml', '''
+name: foo
+version: 1.2.3
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: ">=2.0.0"
+'''),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ]),
+ dir('bar', [
+ file('pubspec.yaml', '''
+name: bar
+version: 2.3.4
+dependencies:
+ baz:
+ repo: {name: baz, url: http://localhost:3123}
+ version: "<3.0.0"
+'''),
+ file('bar.dart', 'main() => print("bar 2.3.4");')
+ ]),
+ dir('baz', [
+ file('pubspec.yaml', '{name: baz, version: 2.0.4}'),
+ file('baz.dart', 'main() => print("baz 2.0.4");')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
}
versionCommand() {
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698