test(credential): Switch more expected results to snapshots (#15929)

### What does this PR try to resolve?

Had to deal with manually updating these when changing notes.
This will avoid that.

### How to test and review this PR?
This commit is contained in:
Scott Schafer 2025-09-05 14:59:15 +00:00 committed by GitHub
commit 43bb5c958b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -555,7 +555,8 @@ fn token_caching() {
.file("src/lib.rs", "")
.build();
let output = r#"[UPDATING] `alternative` index
let output = str![[r#"
[UPDATING] `alternative` index
{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"read"}
[PACKAGING] foo v0.1.0 ([ROOT]/foo)
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
@ -565,7 +566,8 @@ fn token_caching() {
[NOTE] waiting [..]
You may press ctrl-c [..]
[PUBLISHED] foo v0.1.0 at registry `alternative`
"#;
"#]];
// The output should contain two JSON messages from the provider in both cases:
// The first because the credential is expired, the second because the provider
@ -574,7 +576,8 @@ You may press ctrl-c [..]
.with_stderr_data(output)
.run();
let output_non_independent = r#"[UPDATING] `alternative` index
let output_non_independent = str![[r#"
[UPDATING] `alternative` index
{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"read"}
[PACKAGING] foo v0.1.1 ([ROOT]/foo)
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
@ -584,7 +587,8 @@ You may press ctrl-c [..]
[NOTE] waiting [..]
You may press ctrl-c [..]
[PUBLISHED] foo v0.1.1 at registry `alternative`
"#;
"#]];
p.change_file(
"Cargo.toml",