mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
show buggy behavior of not trimming newlines in new credential process test
This commit is contained in:
parent
852a31615d
commit
a498391686
@ -695,3 +695,22 @@ fn alias_builtin_warning() {
|
|||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn login_token_from_stdin() {
|
||||||
|
// Test reading a token from stdin, ensuring newlines are trimmed.
|
||||||
|
let registry = registry::RegistryBuilder::new()
|
||||||
|
.no_configure_token()
|
||||||
|
.credential_provider(&[&build_provider("test-cred", r#"{"Ok": {"kind": "login"}}"#)])
|
||||||
|
.build();
|
||||||
|
|
||||||
|
cargo_process("login")
|
||||||
|
.replace_crates_io(registry.index_url())
|
||||||
|
.with_stdin("abcdefg\n")
|
||||||
|
.with_stderr(
|
||||||
|
r#"[UPDATING] [..]
|
||||||
|
{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg\n","login-url":"[..]"}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user