Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in tests #355

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions validator/tests/display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(derive)]
#[cfg(feature = "derive")]
mod tests {
use validator::Validate;

Expand All @@ -17,13 +17,13 @@ mod tests {

#[derive(Validate)]
struct Bar {
#[validate]
#[validate(nested)]
bar: Foo,
}

#[derive(Validate)]
struct DeepBar {
#[validate]
#[validate(nested)]
deep_bar: Bar,
}

Expand All @@ -41,7 +41,7 @@ mod tests {

#[derive(Validate)]
struct Baz {
#[validate]
#[validate(nested)]
baz: Vec<Foo>,
}

Expand Down
8 changes: 4 additions & 4 deletions validator_derive_tests/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ mod some_defining_mod {
#[derive(Debug, Validate)]
#[validate(schema(function = crate::some_validation_mod::valid_schema_fn))]
pub struct TestStructValid {
pub val: String,
pub _val: String,
}

#[derive(Debug, Validate)]
#[validate(schema(function = crate::some_validation_mod::invalid_schema_fn))]
pub struct TestStructInvalid {
pub val: String,
pub _val: String,
}
}

Expand All @@ -50,14 +50,14 @@ mod some_validation_mod {

#[test]
fn can_validate_fully_qualified_fn_ok() {
let s = some_defining_mod::TestStructValid { val: "hello".into() };
let s = some_defining_mod::TestStructValid { _val: "hello".into() };

assert!(s.validate().is_ok());
}

#[test]
fn can_fail_fully_qualified_fn_validation() {
let s = some_defining_mod::TestStructInvalid { val: "hello".into() };
let s = some_defining_mod::TestStructInvalid { _val: "hello".into() };

let res = s.validate();
assert!(res.is_err());
Expand Down
Loading