aboutsummaryrefslogtreecommitdiffstats
path: root/validator_derive/tests/run-pass
diff options
context:
space:
mode:
authorVincent Prouillet2017-01-18 21:35:01 +0900
committerVincent Prouillet2017-01-19 13:38:47 +0900
commit1fd1b3d708a2737c2a678df8a37e719c29c754bc (patch)
tree67cb2b347ee2dab46bce64fdcfcb1f77a59e9a19 /validator_derive/tests/run-pass
parent8f54c9228d8cf8e2bede37ddc9958db7ce4c63a8 (diff)
downloadvalidator-1fd1b3d708a2737c2a678df8a37e719c29c754bc.tar.bz2
Make it work with lifetimes
Diffstat (limited to 'validator_derive/tests/run-pass')
-rw-r--r--validator_derive/tests/run-pass/lifetime.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/validator_derive/tests/run-pass/lifetime.rs b/validator_derive/tests/run-pass/lifetime.rs
new file mode 100644
index 0000000..8547a1a
--- /dev/null
+++ b/validator_derive/tests/run-pass/lifetime.rs
@@ -0,0 +1,19 @@
+#![feature(attr_literals)]
+
+#[macro_use] extern crate validator_derive;
+extern crate validator;
+use validator::Validate;
+
+#[derive(Validate)]
+struct Test<'a> {
+ #[validate(length(min = 1))]
+ s: &'a str,
+ #[validate(length(min = 1, max = 2))]
+ s2: &'a str,
+ #[validate(length(equal = 1))]
+ s3: &'a str,
+ #[validate(length(max = 1))]
+ s4: &'a str,
+}
+
+fn main() {}