diff options
Diffstat (limited to '')
-rw-r--r-- | src/args.rs | 6 | ||||
-rw-r--r-- | src/auth.rs | 10 | ||||
-rw-r--r-- | src/renderer.rs | 10 | ||||
-rw-r--r-- | tests/auth.rs | 10 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/args.rs b/src/args.rs index fe976ed..3910d06 100644 --- a/src/args.rs +++ b/src/args.rs @@ -179,7 +179,7 @@ pub fn parse_args() -> crate::MiniserveConfig { #[cfg(test)] mod tests { use super::*; - use rstest::rstest_parametrize; + use rstest::rstest; use pretty_assertions::assert_eq; /// Helper function that creates a `RequiredAuth` structure @@ -200,7 +200,7 @@ mod tests { } } - #[rstest_parametrize( + #[rstest( auth_string, username, password, encrypt, case("username:password", "username", "password", "plain"), case("username:sha256:abcd", "username", "abcd", "sha256"), @@ -213,7 +213,7 @@ mod tests { ); } - #[rstest_parametrize( + #[rstest( auth_string, err_msg, case( "foo", diff --git a/src/auth.rs b/src/auth.rs index 1c98c10..34c864c 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -168,7 +168,7 @@ fn build_unauthorized_response( #[cfg(test)] mod tests { use super::*; - use rstest::{rstest, rstest_parametrize, fixture}; + use rstest::{rstest, fixture}; use pretty_assertions::assert_eq; /// Return a hashing function corresponds to given name @@ -180,7 +180,7 @@ mod tests { } } - #[rstest_parametrize( + #[rstest( password, hash_method, hash, case("abc", "sha256", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"), case("abc", "sha512", "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"), @@ -209,7 +209,7 @@ mod tests { } } - #[rstest_parametrize( + #[rstest( should_pass, param_username, param_password, required_username, required_password, encrypt, case(true, "obi", "hello there", "obi", "hello there", "plain"), case(false, "obi", "hello there", "obi", "hi!", "plain"), @@ -254,7 +254,7 @@ mod tests { .collect() } - #[rstest_parametrize( + #[rstest( username, password, case("usr0", "pwd0"), case("usr1", "pwd1"), @@ -288,7 +288,7 @@ mod tests { ), false); } - #[rstest_parametrize( + #[rstest( username, password, case("usr0", "pwd5"), case("usr1", "pwd4"), diff --git a/src/renderer.rs b/src/renderer.rs index 1821c48..32591c3 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -775,27 +775,27 @@ fn css(color_scheme: ColorScheme) -> Markup { size_background_color = theme.size_background_color, size_text_color = theme.size_text_color, error_color = theme.error_color); - (PreEscaped(css)) + PreEscaped(css) } /// Partial: up arrow fn arrow_up() -> Markup { - (PreEscaped("⇪".to_string())) + PreEscaped("⇪".to_string()) } /// Partial: chevron left fn chevron_left() -> Markup { - (PreEscaped("◂".to_string())) + PreEscaped("◂".to_string()) } /// Partial: chevron up fn chevron_up() -> Markup { - (PreEscaped("▴".to_string())) + PreEscaped("▴".to_string()) } /// Partial: chevron up fn chevron_down() -> Markup { - (PreEscaped("▾".to_string())) + PreEscaped("▾".to_string()) } /// Partial: page header diff --git a/tests/auth.rs b/tests/auth.rs index 0afaefd..7074d00 100644 --- a/tests/auth.rs +++ b/tests/auth.rs @@ -5,14 +5,14 @@ use assert_fs::fixture::TempDir; use fixtures::{port, tmpdir, Error, FILES}; use pretty_assertions::assert_eq; use reqwest::StatusCode; -use rstest::{rstest, rstest_parametrize}; +use rstest::rstest; use select::document::Document; use select::predicate::Text; use std::process::{Command, Stdio}; use std::thread::sleep; use std::time::Duration; -#[rstest_parametrize( +#[rstest( cli_auth_arg, client_username, client_password, case("testuser:testpassword", "testuser", "testpassword"), case( @@ -64,7 +64,7 @@ fn auth_accepts( Ok(()) } -#[rstest_parametrize( +#[rstest( cli_auth_arg, client_username, client_password, case("rightuser:rightpassword", "wronguser", "rightpassword"), case( @@ -141,7 +141,7 @@ fn register_accounts<'a>(command: &'a mut Command) -> &'a mut Command { // pwd5 } -#[rstest_parametrize( +#[rstest( username, password, case("usr0", "pwd0"), @@ -216,7 +216,7 @@ fn auth_multiple_accounts_wrong_username(tmpdir: TempDir, port: u16) -> Result<( Ok(()) } -#[rstest_parametrize( +#[rstest( username, password, case("usr0", "pwd5"), |