]> git.proxmox.com Git - cargo.git/commitdiff
Add offline_and_locked_and_no_frozen test
authorhi-rustin <rustin.liu@gmail.com>
Sun, 27 Mar 2022 03:13:24 +0000 (11:13 +0800)
committerhi-rustin <rustin.liu@gmail.com>
Sun, 27 Mar 2022 03:13:24 +0000 (11:13 +0800)
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
tests/testsuite/offline.rs

index 722f59767a5bf269603553c351e3b8df647cbfc7..28f2b543ded89c488bce2d167de20def012aae87 100644 (file)
@@ -700,3 +700,16 @@ remove the --frozen flag and use --offline instead.
 ")
         .run();
 }
+
+#[cargo_test]
+fn offline_and_locked_and_no_frozen() {
+    let p = project().file("src/lib.rs", "").build();
+    p.cargo("build --locked --offline")
+        .with_status(101)
+        .with_stderr("\
+error: the lock file [ROOT]/foo/Cargo.lock needs to be updated but --locked was passed to prevent this
+If you want to try to generate the lock file without accessing the network, \
+remove the --locked flag and use --offline instead.
+")
+        .run();
+}