From 4dc634655edac54e9638e8390d89a96e235522c0 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 10 Jan 2025 17:23:00 +0100 Subject: Reorganize imports to be more consistent --- tests/raw.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/raw.rs') diff --git a/tests/raw.rs b/tests/raw.rs index 95100d2..0017bae 100644 --- a/tests/raw.rs +++ b/tests/raw.rs @@ -1,14 +1,14 @@ -mod fixtures; -mod utils; - -use crate::fixtures::TestServer; -use fixtures::{server, Error}; use pretty_assertions::assert_eq; use reqwest::blocking::Client; use rstest::rstest; -use select::document::Document; -use select::predicate::Class; -use select::predicate::Name; +use select::{ + document::Document, + predicate::{Class, Name}, +}; + +mod fixtures; + +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, -- cgit v1.2.3 From 57f02a1587555176f1b43b001e7846ac9eb2e949 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Thu, 6 Feb 2025 05:18:20 +0100 Subject: Clean up and modernize rstest usage We still had some old-style syntax in there. --- tests/raw.rs | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'tests/raw.rs') 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 -- cgit v1.2.3