From 7ea4bb808df29cc618397ed6b2fcb9a1d7578c97 Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 3 Nov 2023 15:25:20 +0800 Subject: [PATCH] refactor: optimize tests --- tests/bind.rs | 4 +--- tests/log_http.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/bind.rs b/tests/bind.rs index 517822e..2776b24 100644 --- a/tests/bind.rs +++ b/tests/bind.rs @@ -76,9 +76,7 @@ fn validate_printed_urls(tmpdir: TempDir, port: u16, #[case] args: &[&str]) -> R .collect::>(); 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()?; diff --git a/tests/log_http.rs b/tests/log_http.rs index 3cb9bad..d850ec6 100644 --- a/tests/log_http.rs +++ b/tests/log_http.rs @@ -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])?;