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

Side by Side Diff: utils/tests/pub/install/pub_install_test.dart

Issue 13095015: Use backtracking when solving dependency constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise, update to latest corelib, and make backtracker default. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.file 1 // Copyright (c) 2012, 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 library pub_tests; 5 library pub_tests;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:pathos/path.dart' as path; 9 import 'package:pathos/path.dart' as path;
10 import 'package:scheduled_test/scheduled_test.dart'; 10 import 'package:scheduled_test/scheduled_test.dart';
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 schedulePub(args: ['install'], 47 schedulePub(args: ['install'],
48 output: new RegExp(r"Dependencies installed!$")); 48 output: new RegExp(r"Dependencies installed!$"));
49 49
50 d.dir(packagesPath, [ 50 d.dir(packagesPath, [
51 d.dir("myapp_name", [ 51 d.dir("myapp_name", [
52 d.file('foo.dart', 'main() => "foo";') 52 d.file('foo.dart', 'main() => "foo";')
53 ]) 53 ])
54 ]).validate(); 54 ]).validate();
55 }); 55 });
56 56
57 integration('does not adds itself to the packages if it has no "lib" directory ', () { 57 integration('does not add itself to the packages if it has no "lib" directory' , () {
58 // The symlink should use the name in the pubspec, not the name of the 58 // The symlink should use the name in the pubspec, not the name of the
59 // directory. 59 // directory.
60 d.dir(appPath, [ 60 d.dir(appPath, [
61 d.pubspec({"name": "myapp_name"}), 61 d.pubspec({"name": "myapp_name"}),
62 ]).create(); 62 ]).create();
63 63
64 schedulePub(args: ['install'], 64 schedulePub(args: ['install'],
65 output: new RegExp(r"Dependencies installed!$")); 65 output: new RegExp(r"Dependencies installed!$"));
66 66
67 d.dir(packagesPath, [ 67 d.dir(packagesPath, [
(...skipping 11 matching lines...) Expand all
79 d.pubspec({"name": "myapp", "dependencies": {"foo": {"path": "../foo"}}}) 79 d.pubspec({"name": "myapp", "dependencies": {"foo": {"path": "../foo"}}})
80 ]).create(); 80 ]).create();
81 81
82 schedulePub(args: ['install'], 82 schedulePub(args: ['install'],
83 error: new RegExp(r'Warning: Package "foo" does not have a "lib" ' 83 error: new RegExp(r'Warning: Package "foo" does not have a "lib" '
84 'directory so you will not be able to import any libraries from ' 84 'directory so you will not be able to import any libraries from '
85 'it.'), 85 'it.'),
86 output: new RegExp(r"Dependencies installed!$")); 86 output: new RegExp(r"Dependencies installed!$"));
87 }); 87 });
88 88
89 integration('reports a solver failure', () {
90 // myapp depends on foo and bar which both depend on baz with mismatched
91 // descriptions.
92 d.dir('deps', [
93 d.dir('foo', [
94 d.pubspec({"name": "foo", "dependencies": {
95 "baz": {"path": "../baz1"}
96 }})
97 ]),
98 d.dir('bar', [
99 d.pubspec({"name": "bar", "dependencies": {
100 "baz": {"path": "../baz2"}
101 }})
102 ]),
103 d.dir('baz1', [
104 d.libPubspec('baz', '0.0.0')
105 ]),
106 d.dir('baz2', [
107 d.libPubspec('baz', '0.0.0')
108 ])
109 ]).create();
110
111 d.dir(appPath, [
112 d.pubspec({"name": "myapp", "dependencies": {
113 "foo": {"path": "../deps/foo"},
114 "bar": {"path": "../deps/bar"}
115 }})
116 ]).create();
117
118 schedulePub(args: ['install'],
119 error: new RegExp(r"^Incompatible dependencies on 'baz':"),
120 exitCode: 1);
121 });
122
89 integration('does not warn if the root package lacks a "lib" directory', () { 123 integration('does not warn if the root package lacks a "lib" directory', () {
90 d.dir(appPath, [ 124 d.dir(appPath, [
91 d.appPubspec([]) 125 d.appPubspec([])
92 ]).create(); 126 ]).create();
93 127
94 schedulePub(args: ['install'], 128 schedulePub(args: ['install'],
95 error: new RegExp(r'^\s*$'), 129 error: new RegExp(r'^\s*$'),
96 output: new RegExp(r"Dependencies installed!$")); 130 output: new RegExp(r"Dependencies installed!$"));
97 }); 131 });
98 132
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 d.dir("packages", [ 300 d.dir("packages", [
267 d.dir("myapp", [ 301 d.dir("myapp", [
268 d.file('foo.dart', 'main() => "foo";') 302 d.file('foo.dart', 'main() => "foo";')
269 ]) 303 ])
270 ]) 304 ])
271 ]) 305 ])
272 ]).validate(); 306 ]).validate();
273 }); 307 });
274 }); 308 });
275 } 309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698