refactor: optimize tests

This commit is contained in:
sigoden 2023-11-03 15:25:20 +08:00
parent 6766e0d437
commit 7ea4bb808d
2 changed files with 2 additions and 4 deletions

View file

@ -76,9 +76,7 @@ fn validate_printed_urls(tmpdir: TempDir, port: u16, #[case] args: &[&str]) -> R
.collect::<Vec<_>>();
assert!(!urls.is_empty());
for url in urls {
reqwest::blocking::get(url)?.error_for_status()?;
}
reqwest::blocking::get(urls[0])?.error_for_status()?;
child.kill()?;

View file

@ -41,7 +41,7 @@ fn log_remote_user(
assert_eq!(resp.status(), 200);
let mut buf = [0; 1000];
let mut buf = [0; 2000];
let buf_len = stdout.read(&mut buf)?;
let output = std::str::from_utf8(&buf[0..buf_len])?;