| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart'; | 9 import 'package:http/testing.dart'; |
| 10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 })); | 52 })); |
| 53 | 53 |
| 54 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { | 54 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { |
| 55 "foo": dep | 55 "foo": dep |
| 56 })]).create(); | 56 })]).create(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 main() { | 59 main() { |
| 60 initConfig(); | 60 initConfig(); |
| 61 | 61 |
| 62 integration('should consider a package valid if it looks normal', () { | 62 group('should consider a package valid if it', () { |
| 63 d.validPackage.create(); | 63 integration('looks normal', () { |
| 64 expectNoValidationError(dependency); | 64 d.validPackage.create(); |
| 65 expectNoValidationError(dependency); |
| 66 }); |
| 67 |
| 68 integration('has a ^ constraint with an appropriate SDK constraint', () { |
| 69 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { |
| 70 "foo": "^1.2.3" |
| 71 }, sdk: ">=1.8.0 <2.0.0")]).create(); |
| 72 expectNoValidationError(dependency); |
| 73 }); |
| 65 }); | 74 }); |
| 66 | 75 |
| 67 group('should consider a package invalid if it', () { | 76 group('should consider a package invalid if it', () { |
| 68 setUp(d.validPackage.create); | 77 setUp(d.validPackage.create); |
| 69 | 78 |
| 70 group('has a git dependency', () { | 79 group('has a git dependency', () { |
| 71 group('where a hosted version exists', () { | 80 group('where a hosted version exists', () { |
| 72 integration("and should suggest the hosted primary version", () { | 81 integration("and should suggest the hosted primary version", () { |
| 73 setUpDependency({ | 82 setUpDependency({ |
| 74 'git': 'git://github.com/dart-lang/foo' | 83 'git': 'git://github.com/dart-lang/foo' |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 }); | 382 }); |
| 374 | 383 |
| 375 integration('and it should preserve the lower-bound operator', () { | 384 integration('and it should preserve the lower-bound operator', () { |
| 376 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { | 385 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { |
| 377 "foo": ">1.2.3" | 386 "foo": ">1.2.3" |
| 378 })]).create(); | 387 })]).create(); |
| 379 | 388 |
| 380 expectDependencyValidationWarning(' foo: ">1.2.3 <2.0.0"'); | 389 expectDependencyValidationWarning(' foo: ">1.2.3 <2.0.0"'); |
| 381 }); | 390 }); |
| 382 }); | 391 }); |
| 392 |
| 393 group('has a ^ dependency', () { |
| 394 integration("without an SDK constraint", () { |
| 395 d.dir(appPath, [d.libPubspec("integration_pkg", "1.0.0", deps: { |
| 396 "foo": "^1.2.3" |
| 397 })]).create(); |
| 398 |
| 399 expectDependencyValidationError(' foo: ">=1.2.3 <2.0.0"'); |
| 400 }); |
| 401 |
| 402 integration("with a too-broad SDK constraint", () { |
| 403 d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: { |
| 404 "foo": "^1.2.3" |
| 405 }, sdk: ">=1.5.0 <2.0.0")]).create(); |
| 406 |
| 407 expectDependencyValidationError(' foo: ">=1.2.3 <2.0.0"'); |
| 408 }); |
| 409 }); |
| 383 }); | 410 }); |
| 384 } | 411 } |
| OLD | NEW |