diff options
| author | Vincent Prouillet | 2019-10-17 23:02:51 +0200 |
|---|---|---|
| committer | Vincent Prouillet | 2019-10-17 23:02:51 +0200 |
| commit | 52cd62998b8f45be56512ce1d89aef8bf1a9f670 (patch) | |
| tree | 7469738d72627423c5b99df7dfae099951f4d322 /validator_derive/tests | |
| parent | f57048e58c59317ec18a37a86e7fd848670fff85 (diff) | |
| download | validator-52cd62998b8f45be56512ce1d89aef8bf1a9f670.tar.bz2 | |
Fix bug + cargo fmt
Diffstat (limited to 'validator_derive/tests')
| -rw-r--r-- | validator_derive/tests/regex.rs | 8 | ||||
| -rw-r--r-- | validator_derive/tests/run-pass/custom.rs | 4 | ||||
| -rw-r--r-- | validator_derive/tests/run-pass/regex.rs | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/validator_derive/tests/regex.rs b/validator_derive/tests/regex.rs index 7e3dfc5..d3e3c1e 100644 --- a/validator_derive/tests/regex.rs +++ b/validator_derive/tests/regex.rs @@ -16,7 +16,7 @@ lazy_static! { fn can_validate_valid_regex() { #[derive(Debug, Validate)] struct TestStruct { - #[validate(regex = "RE2")] + #[validate(regex = "crate::RE2")] val: String, } @@ -29,7 +29,7 @@ fn can_validate_valid_regex() { fn bad_value_for_regex_fails_validation() { #[derive(Debug, Validate)] struct TestStruct { - #[validate(regex = "RE2")] + #[validate(regex = "crate::RE2")] val: String, } @@ -48,7 +48,7 @@ fn bad_value_for_regex_fails_validation() { fn can_specify_code_for_regex() { #[derive(Debug, Validate)] struct TestStruct { - #[validate(regex(path = "RE2", code = "oops"))] + #[validate(regex(path = "crate::RE2", code = "oops"))] val: String, } let s = TestStruct { val: "2".to_string() }; @@ -65,7 +65,7 @@ fn can_specify_code_for_regex() { fn can_specify_message_for_regex() { #[derive(Debug, Validate)] struct TestStruct { - #[validate(regex(path = "RE2", message = "oops"))] + #[validate(regex(path = "crate::RE2", message = "oops"))] val: String, } let s = TestStruct { val: "2".to_string() }; diff --git a/validator_derive/tests/run-pass/custom.rs b/validator_derive/tests/run-pass/custom.rs index dff6375..f745de6 100644 --- a/validator_derive/tests/run-pass/custom.rs +++ b/validator_derive/tests/run-pass/custom.rs @@ -6,13 +6,13 @@ use validator::{Validate, ValidationError}; #[derive(Validate)] struct Test { - #[validate(custom = "validate_something")] + #[validate(custom = "crate::validate_something")] s: String, } #[derive(Validate)] struct TestPath { - #[validate(custom = "::validate_something")] + #[validate(custom = "crate::validate_something")] s: String, } diff --git a/validator_derive/tests/run-pass/regex.rs b/validator_derive/tests/run-pass/regex.rs index dcac3c0..e15b3a6 100644 --- a/validator_derive/tests/run-pass/regex.rs +++ b/validator_derive/tests/run-pass/regex.rs @@ -14,13 +14,13 @@ lazy_static! { #[derive(Validate)] struct Test { - #[validate(regex = "RE2")] + #[validate(regex = "crate::RE2")] s: String, } #[derive(Validate)] struct TestPath { - #[validate(regex = "::RE2")] + #[validate(regex = "crate::RE2")] s: String, } |
