Skip to content

Commit 226cde8

Browse files
committed
test: lockfile-path install
- Showcase that install is not supported (yet)
1 parent 32f024f commit 226cde8

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

tests/testsuite/lockfile_path.rs

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use snapbox::str;
77
use cargo_test_support::compare::assert_e2e;
88
use cargo_test_support::registry::{Package, RegistryBuilder};
99
use cargo_test_support::{
10-
basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder,
10+
basic_bin_manifest, cargo_process, cargo_test, project, symlink_supported, ProjectBuilder,
1111
};
1212

1313
///////////////////////////////
@@ -400,6 +400,56 @@ bar = "0.1.0"
400400
assert_e2e().eq(contents, lockfile_original);
401401
}
402402

403+
#[cargo_test]
404+
fn install_not_supported() {
405+
Package::new("bar", "0.1.0").publish();
406+
Package::new("bar", "0.1.1")
407+
.file("src/lib.rs", "not rust")
408+
.publish();
409+
Package::new("foo", "0.1.0")
410+
.dep("bar", "0.1")
411+
.file("src/lib.rs", "")
412+
.file(
413+
"src/main.rs",
414+
"extern crate foo; extern crate bar; fn main() {}",
415+
)
416+
.file(
417+
"Cargo.lock",
418+
r#"
419+
[[package]]
420+
name = "bar"
421+
version = "0.1.0"
422+
source = "registry+https://github.com/rust-lang/crates.io-index"
423+
424+
[[package]]
425+
name = "foo"
426+
version = "0.1.0"
427+
dependencies = [
428+
"bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
429+
]
430+
"#,
431+
)
432+
.publish();
433+
434+
cargo_process("install foo")
435+
.with_stderr_data(str![[r#"
436+
...
437+
[..]not rust[..]
438+
...
439+
"#]])
440+
.with_status(101)
441+
.run();
442+
cargo_process("install foo -Zunstable-options --lockfile-path lockfile_dir/Cargo.lock")
443+
.masquerade_as_nightly_cargo(&["lockfile-path"])
444+
.with_stderr_data(str![[r#"
445+
...
446+
[ERROR] unexpected argument '--lockfile-path' found
447+
...
448+
"#]])
449+
.with_status(1)
450+
.run();
451+
}
452+
403453
#[cargo_test]
404454
fn run_embed() {
405455
let lockfile_path = "mylockfile/Cargo.lock";

0 commit comments

Comments
 (0)