From 287e83a27988fb7de5871e9ce4c8ba8c515b2076 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 29 May 2018 22:22:01 +0200 Subject: Prepare for release --- validator_derive/tests/credit_card.rs | 5 ++++- validator_derive/tests/phone.rs | 4 ++++ validator_derive/tests/run-pass/phone.rs | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'validator_derive/tests') diff --git a/validator_derive/tests/credit_card.rs b/validator_derive/tests/credit_card.rs index fcb30a1..a430971 100644 --- a/validator_derive/tests/credit_card.rs +++ b/validator_derive/tests/credit_card.rs @@ -4,7 +4,7 @@ extern crate validator; use validator::Validate; - +#[cfg(feature = "card")] #[test] fn can_validate_valid_card_number() { #[derive(Debug, Validate)] @@ -20,6 +20,7 @@ fn can_validate_valid_card_number() { assert!(s.validate().is_ok()); } +#[cfg(feature = "card")] #[test] fn bad_credit_card_fails_validation() { #[derive(Debug, Validate)] @@ -40,6 +41,7 @@ fn bad_credit_card_fails_validation() { assert_eq!(errs["val"][0].params["value"], "bob"); } +#[cfg(feature = "card")] #[test] fn can_specify_code_for_credit_card() { #[derive(Debug, Validate)] @@ -58,6 +60,7 @@ fn can_specify_code_for_credit_card() { assert_eq!(errs["val"][0].code, "oops"); } +#[cfg(feature = "card")] #[test] fn can_specify_message_for_credit_card() { #[derive(Debug, Validate)] diff --git a/validator_derive/tests/phone.rs b/validator_derive/tests/phone.rs index 675d4c5..ad8f3cd 100644 --- a/validator_derive/tests/phone.rs +++ b/validator_derive/tests/phone.rs @@ -5,6 +5,7 @@ extern crate validator; use validator::Validate; +#[cfg(feature = "phone")] #[test] fn can_validate_phone_ok() { #[derive(Debug, Validate)] @@ -20,6 +21,7 @@ fn can_validate_phone_ok() { assert!(s.validate().is_ok()); } +#[cfg(feature = "phone")] #[test] fn bad_phone_fails_validation() { #[derive(Debug, Validate)] @@ -39,6 +41,7 @@ fn bad_phone_fails_validation() { assert_eq!(errs["val"][0].code, "phone"); } +#[cfg(feature = "phone")] #[test] fn can_specify_code_for_phone() { #[derive(Debug, Validate)] @@ -58,6 +61,7 @@ fn can_specify_code_for_phone() { assert_eq!(errs["val"][0].params["value"], "bob"); } +#[cfg(feature = "phone")] #[test] fn can_specify_message_for_phone() { #[derive(Debug, Validate)] diff --git a/validator_derive/tests/run-pass/phone.rs b/validator_derive/tests/run-pass/phone.rs index d6dff9e..b8766db 100644 --- a/validator_derive/tests/run-pass/phone.rs +++ b/validator_derive/tests/run-pass/phone.rs @@ -4,6 +4,7 @@ extern crate validator; use validator::Validate; +#[cfg(feature = "phone")] #[derive(Validate)] struct Test { #[validate(phone)] -- cgit v1.2.3