tests: use println rather then eprintln in tests

This should reduce the noise in output when a test is running and passing.
This commit is contained in:
Paul Campbell 2024-06-20 18:54:01 +01:00
parent 8ce4528c88
commit b9940cd205
4 changed files with 13 additions and 13 deletions

View file

@ -30,7 +30,7 @@ fn test_github_name() {
fn given_fs() -> kxio::fs::FileSystem {
kxio::fs::temp().unwrap_or_else(|e| {
eprintln!("{e}");
println!("{e}");
panic!("fs")
})
}

View file

@ -82,7 +82,7 @@ impl git::repository::OpenRepositoryLike for TestOpenRepository {
.read()
.map_err(|_| git::fetch::Error::Lock)?
.deref();
eprintln!("Fetch: {i}");
println!("Fetch: {i}");
self.fetch_counter
.write()
.map_err(|_| git::fetch::Error::Lock)
@ -104,7 +104,7 @@ impl git::repository::OpenRepositoryLike for TestOpenRepository {
.read()
.map_err(|_| git::fetch::Error::Lock)?
.deref();
eprintln!("Push: {i}");
println!("Push: {i}");
self.push_counter
.write()
.map_err(|_| git::fetch::Error::Lock)

View file

@ -450,22 +450,22 @@ pub mod then {
}
fn exec(label: String, output: Result<std::process::Output, std::io::Error>) -> TestResult {
eprintln!("== {label}");
println!("== {label}");
match output {
Ok(output) => {
eprintln!(
println!(
"\nstdout:\n{}",
String::from_utf8_lossy(output.stdout.as_slice())
);
eprintln!(
println!(
"\nstderr:\n{}",
String::from_utf8_lossy(output.stderr.as_slice())
);
eprintln!("=============================");
println!("=============================");
Ok(())
}
Err(err) => {
eprintln!("ERROR: {err:#?}");
println!("ERROR: {err:#?}");
Ok(Err(err)?)
}
}

View file

@ -343,7 +343,7 @@ mod positions {
);
//then
eprintln!("Got: {err:?}");
println!("Got: {err:?}");
// NOTE: assertions for correct push are in on_push above
assert!(matches!(
err,
@ -414,7 +414,7 @@ mod positions {
);
//then
eprintln!("Got: {err:?}");
println!("Got: {err:?}");
let_assert!(
Ok(sha_next) =
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
@ -504,7 +504,7 @@ mod positions {
);
//then
eprintln!("Got: {err:?}");
println!("Got: {err:?}");
// NOTE: assertions for correct push are in on_push above
assert!(matches!(
err,
@ -573,7 +573,7 @@ mod positions {
);
//then
eprintln!("Got: {err:?}");
println!("Got: {err:?}");
let_assert!(
Ok(sha_next) =
then::get_sha_for_branch(&fs, &gitdir, &repo_config.branches().next()),
@ -626,7 +626,7 @@ mod positions {
);
//then
eprintln!("positions: {positions:#?}");
println!("positions: {positions:#?}");
let_assert!(
Ok(main_sha) =