diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2025-02-06 04:18:20 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2025-02-06 04:18:20 +0000 |
commit | 57f02a1587555176f1b43b001e7846ac9eb2e949 (patch) | |
tree | 6585f2d404ae55506f4e25985ce663cea7092788 /tests/raw.rs | |
parent | Get rid of server_no_stderr (diff) | |
download | miniserve-57f02a1587555176f1b43b001e7846ac9eb2e949.tar.gz miniserve-57f02a1587555176f1b43b001e7846ac9eb2e949.zip |
Clean up and modernize rstest usage
We still had some old-style syntax in there.
Diffstat (limited to 'tests/raw.rs')
-rw-r--r-- | tests/raw.rs | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/raw.rs b/tests/raw.rs index 0017bae..051c3e3 100644 --- a/tests/raw.rs +++ b/tests/raw.rs @@ -13,18 +13,15 @@ use crate::fixtures::{server, Error, TestServer}; /// The footer displays the correct wget command to download the folder recursively // This test can't test all aspects of the wget footer, // a more detailed unit test is available -#[rstest( - depth, - dir, - case(0, ""), - case(1, "dira/"), - case(2, "very/deeply/"), - case(3, "very/deeply/nested/") -)] +#[rstest] +#[case(0, "")] +#[case(1, "dira/")] +#[case(2, "very/deeply/")] +#[case(3, "very/deeply/nested/")] fn ui_displays_wget_element( - depth: u8, - dir: &str, - #[with(&["-W"])] server: TestServer, + #[case] depth: u8, + #[case] dir: &str, + #[with(&["--show-wget-footer"])] server: TestServer, ) -> Result<(), Error> { let client = Client::new(); @@ -62,16 +59,14 @@ fn ui_displays_wget_element( } /// All hrefs in raw mode are links to directories or files & directories end with ?raw=true -#[rstest( - dir, - case(""), - case("very/"), - case("very/deeply/"), - case("very/deeply/nested/") -)] +#[rstest] +#[case("")] +#[case("very/")] +#[case("very/deeply/")] +#[case("very/deeply/nested/")] fn raw_mode_links_to_directories_end_with_raw_true( - dir: &str, - #[with(&["-W"])] server: TestServer, + #[case] dir: &str, + #[with(&["--show-wget-footer"])] server: TestServer, ) -> Result<(), Error> { fn verify_a_tags(parsed: Document) { // Ensure all links end with ?raw=true or are files |