From ade9820f497d678296530bbf13bb4de46253d0fe Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 16 Jan 2017 20:56:05 +0900 Subject: Struct level validation --- .../tests/compile-fail/schema/missing_function.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 validator_derive/tests/compile-fail/schema/missing_function.rs (limited to 'validator_derive/tests/compile-fail') 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() {} -- cgit v1.2.3