aboutsummaryrefslogtreecommitdiffstats
path: root/validator_derive/tests
diff options
context:
space:
mode:
Diffstat (limited to 'validator_derive/tests')
-rw-r--r--validator_derive/tests/regex.rs8
-rw-r--r--validator_derive/tests/run-pass/custom.rs4
-rw-r--r--validator_derive/tests/run-pass/regex.rs4
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,
}