| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 schedulePub(args: ['install'], | 48 schedulePub(args: ['install'], |
| 49 output: new RegExp(r"Dependencies installed!$")); | 49 output: new RegExp(r"Dependencies installed!$")); |
| 50 | 50 |
| 51 d.dir(packagesPath, [ | 51 d.dir(packagesPath, [ |
| 52 d.dir("myapp_name", [ | 52 d.dir("myapp_name", [ |
| 53 d.file('foo.dart', 'main() => "foo";') | 53 d.file('foo.dart', 'main() => "foo";') |
| 54 ]) | 54 ]) |
| 55 ]).validate(); | 55 ]).validate(); |
| 56 }); | 56 }); |
| 57 | 57 |
| 58 integration('does not adds itself to the packages if it has no "lib" directory
', () { | 58 integration('does not add itself to the packages if it has no "lib" directory'
, () { |
| 59 // The symlink should use the name in the pubspec, not the name of the | 59 // The symlink should use the name in the pubspec, not the name of the |
| 60 // directory. | 60 // directory. |
| 61 d.dir(appPath, [ | 61 d.dir(appPath, [ |
| 62 d.pubspec({"name": "myapp_name"}), | 62 d.pubspec({"name": "myapp_name"}), |
| 63 ]).create(); | 63 ]).create(); |
| 64 | 64 |
| 65 schedulePub(args: ['install'], | 65 schedulePub(args: ['install'], |
| 66 output: new RegExp(r"Dependencies installed!$")); | 66 output: new RegExp(r"Dependencies installed!$")); |
| 67 | 67 |
| 68 d.dir(packagesPath, [ | 68 d.dir(packagesPath, [ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 d.pubspec({"name": "myapp", "dependencies": {"foo": {"path": "../foo"}}}) | 80 d.pubspec({"name": "myapp", "dependencies": {"foo": {"path": "../foo"}}}) |
| 81 ]).create(); | 81 ]).create(); |
| 82 | 82 |
| 83 schedulePub(args: ['install'], | 83 schedulePub(args: ['install'], |
| 84 error: new RegExp(r'Warning: Package "foo" does not have a "lib" ' | 84 error: new RegExp(r'Warning: Package "foo" does not have a "lib" ' |
| 85 'directory so you will not be able to import any libraries from ' | 85 'directory so you will not be able to import any libraries from ' |
| 86 'it.'), | 86 'it.'), |
| 87 output: new RegExp(r"Dependencies installed!$")); | 87 output: new RegExp(r"Dependencies installed!$")); |
| 88 }); | 88 }); |
| 89 | 89 |
| 90 integration('reports a solver failure', () { |
| 91 // myapp depends on foo and bar which both depend on baz with mismatched |
| 92 // descriptions. |
| 93 d.dir('deps', [ |
| 94 d.dir('foo', [ |
| 95 d.pubspec({"name": "foo", "dependencies": { |
| 96 "baz": {"path": "../baz1"} |
| 97 }}) |
| 98 ]), |
| 99 d.dir('bar', [ |
| 100 d.pubspec({"name": "bar", "dependencies": { |
| 101 "baz": {"path": "../baz2"} |
| 102 }}) |
| 103 ]), |
| 104 d.dir('baz1', [ |
| 105 d.libPubspec('baz', '0.0.0') |
| 106 ]), |
| 107 d.dir('baz2', [ |
| 108 d.libPubspec('baz', '0.0.0') |
| 109 ]) |
| 110 ]).create(); |
| 111 |
| 112 d.dir(appPath, [ |
| 113 d.pubspec({"name": "myapp", "dependencies": { |
| 114 "foo": {"path": "../deps/foo"}, |
| 115 "bar": {"path": "../deps/bar"} |
| 116 }}) |
| 117 ]).create(); |
| 118 |
| 119 schedulePub(args: ['install'], |
| 120 error: new RegExp(r"^Incompatible dependency descriptions on 'baz':"), |
| 121 exitCode: 1); |
| 122 }); |
| 123 |
| 90 integration('does not warn if the root package lacks a "lib" directory', () { | 124 integration('does not warn if the root package lacks a "lib" directory', () { |
| 91 d.dir(appPath, [ | 125 d.dir(appPath, [ |
| 92 d.appPubspec([]) | 126 d.appPubspec([]) |
| 93 ]).create(); | 127 ]).create(); |
| 94 | 128 |
| 95 schedulePub(args: ['install'], | 129 schedulePub(args: ['install'], |
| 96 error: new RegExp(r'^\s*$'), | 130 error: new RegExp(r'^\s*$'), |
| 97 output: new RegExp(r"Dependencies installed!$")); | 131 output: new RegExp(r"Dependencies installed!$")); |
| 98 }); | 132 }); |
| 99 | 133 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 d.dir("packages", [ | 301 d.dir("packages", [ |
| 268 d.dir("myapp", [ | 302 d.dir("myapp", [ |
| 269 d.file('foo.dart', 'main() => "foo";') | 303 d.file('foo.dart', 'main() => "foo";') |
| 270 ]) | 304 ]) |
| 271 ]) | 305 ]) |
| 272 ]) | 306 ]) |
| 273 ]).validate(); | 307 ]).validate(); |
| 274 }); | 308 }); |
| 275 }); | 309 }); |
| 276 } | 310 } |
| OLD | NEW |