diff options
| author | Vincent Prouillet | 2017-01-16 20:56:05 +0900 |
|---|---|---|
| committer | Vincent Prouillet | 2017-01-16 20:56:05 +0900 |
| commit | ade9820f497d678296530bbf13bb4de46253d0fe (patch) | |
| tree | ab821e4d55e1fd2af4d0ef22e5c2336ba69343cf /validator_derive/tests/compile-fail | |
| parent | 3302d261744c12001ec2cd980fffd32a829185aa (diff) | |
| download | validator-ade9820f497d678296530bbf13bb4de46253d0fe.tar.bz2 | |
Struct level validation
Diffstat (limited to 'validator_derive/tests/compile-fail')
| -rw-r--r-- | validator_derive/tests/compile-fail/schema/missing_function.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validator_derive/tests/compile-fail/schema/missing_function.rs b/validator_derive/tests/compile-fail/schema/missing_function.rs new file mode 100644 index 0000000..cacb328 --- /dev/null +++ b/validator_derive/tests/compile-fail/schema/missing_function.rs @@ -0,0 +1,20 @@ +#![feature(proc_macro, attr_literals)] + +#[macro_use] extern crate validator_derive; +extern crate validator; +use validator::Validate; + +#[derive(Validate)] +//~^ ERROR: custom derive attribute panicked +//~^^ HELP: Invalid schema level validation: `function` is required +#[validate(schema())] +struct Test { + s: i32, +} + +fn hey(_: &Test) -> Option<(String, String)> { + None +} + + +fn main() {} |
