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

Unified Diff: test/must_pub_get_test.dart

Issue 1534093002: Improve the detection lockfile freshness. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years 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
Index: test/must_pub_get_test.dart
diff --git a/test/must_pub_get_test.dart b/test/must_pub_get_test.dart
index 981d9ff13a417373f5be50ef0f2445b17785c52a..c81646c919238b28dff92aa2c6e5ffaf37725a63 100644
--- a/test/must_pub_get_test.dart
+++ b/test/must_pub_get_test.dart
@@ -265,6 +265,46 @@ foo:http://example.com/
_requiresPubGet('The pubspec.lock file has changed since the .packages '
'file was generated, please run "pub get" again.');
});
+
+ group("the lock file's SDK constraint doesn't match the current SDK", () {
+ setUp(() {
+ // Avoid using a path dependency because it triggers the full validation
+ // logic. We want to be sure SDK-validation works without that logic.
+ servePackages((builder) {
+ builder.serve("foo", "3.0.0", pubspec: {
+ "environment": {"sdk": ">=1.0.0 <2.0.0"}
+ });
+ });
+
+ d.dir(appPath, [
+ d.appPubspec({"foo": "3.0.0"})
+ ]).create();
+
+ pubGet(environment: {"_PUB_TEST_SDK_VERSION": "1.2.3+4"});
+ });
+
+ _requiresPubGet("Dart 0.1.2+3 is incompatible with your dependencies' "
+ "SDK constraints. Please run \"pub get\" again.");
+ });
+
+ group("a path dependency's dependency doesn't match the lockfile", () {
+ setUp(() {
+ d.dir("bar", [
+ d.libPubspec("bar", "1.0.0", deps: {"foo": "1.0.0"})
+ ]).create();
+
+ d.dir(appPath, [
+ d.appPubspec({"foo": {"path": "../foo"}})
+ ]);
+
+ pubGet();
+
+ // Update foo's pubspec without touching the app's.
+ d.dir("bar", [
+ d.libPubspec("bar", "1.0.0", deps: {"foo": "2.0.0"})
+ ]).create();
+ });
+ });
});
group("doesn't require the user to run pub get first if", () {
« lib/src/lock_file.dart ('K') | « lib/src/source_registry.dart ('k') | test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698