mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(generate-lockfile): verify --offline
panics
This commit is contained in:
parent
5b2b1c036c
commit
e186bf4e7a
@ -237,3 +237,41 @@ fn duplicate_entries_in_lockfile() {
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn generate_lockfile_holds_lock_and_offline() {
|
||||
Package::new("syn", "1.0.0").publish();
|
||||
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
|
||||
[dependencies]
|
||||
syn = "1.0"
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("generate-lockfile")
|
||||
.with_stderr(
|
||||
"\
|
||||
[UPDATING] `[..]` index
|
||||
[LOCKING] 2 packages
|
||||
",
|
||||
)
|
||||
.run();
|
||||
|
||||
p.cargo("generate-lockfile --offline")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[..]thread 'main' panicked[..]
|
||||
[..]package cache lock is not currently held[..]
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user