Skip to content

Commit

Permalink
Test: Add new regression test for #7
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
  • Loading branch information
PaulDance committed Feb 3, 2024
1 parent 239e422 commit a75aa32
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
INFO cargo_liner::cargo > Fetching latest package versions...
Updating `dummy-registry` index
INFO cargo_liner > Results:
INFO cargo_liner > --pkg ø -> 0.0.0
INFO cargo_liner::cargo > Installing `--pkg`...
Updating `dummy-registry` index
Downloading crates ...
Downloaded --pkg v0.0.0 (registry `dummy-registry`)
error: failed to download replaced source registry `crates-io`

Caused by:
failed to parse manifest at `[..]/--pkg-0.0.0/Cargo.toml`

Caused by:
invalid character `-` in package name: `--pkg`, the first character must be a Unicode XID start character (most letters or `_`)
INFO cargo_liner > Done.
19 changes: 19 additions & 0 deletions tests/ship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,3 +834,22 @@ fn validate_ship_weirdversions_supported() {
.stderr_matches_path("tests/fixtures/ship/validate_ship_weirdversions_supported.stderr");
assert_installed("pkg");
}

/// See #7
#[cargo_test]
fn validate_ship_weirdpackagenames_supported() {
let _reg = init_registry();
fake_install_self();
fake_publish("--pkg", "0.0.0");
write_user_config(&["[packages]", "--pkg = '*'"]);

cargo_liner()
.args(["ship", "--no-self"])
.assert()
.success()
.stdout_eq("")
.stderr_matches_path(
"tests/fixtures/ship/validate_ship_weirdpackagenames_supported.stderr",
);
assert_not_installed("--pkg");
}

0 comments on commit a75aa32

Please sign in to comment.