diff options
Diffstat (limited to 'tests/trybuild')
| -rw-r--r-- | tests/trybuild/invalid-attribute.rs | 21 | ||||
| -rw-r--r-- | tests/trybuild/invalid-attribute.stderr | 23 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/trybuild/invalid-attribute.rs b/tests/trybuild/invalid-attribute.rs new file mode 100644 index 0000000..01f081e --- /dev/null +++ b/tests/trybuild/invalid-attribute.rs @@ -0,0 +1,21 @@ +use get::Get; + +#[derive(Get)] +pub struct Cat { + #[get()] + name: String, +} + +#[derive(Get)] +pub struct Dog { + #[get] + name: String, +} + +#[derive(Get)] +pub struct Crab { + #[get(invalid_name = "invalid_value")] + name: String, +} + +pub fn main() {} diff --git a/tests/trybuild/invalid-attribute.stderr b/tests/trybuild/invalid-attribute.stderr new file mode 100644 index 0000000..426cc06 --- /dev/null +++ b/tests/trybuild/invalid-attribute.stderr @@ -0,0 +1,23 @@ +error: proc-macro derive panicked + --> tests/trybuild/invalid-attribute.rs:3:10 + | +3 | #[derive(Get)] + | ^^^ + | + = help: message: called `Result::unwrap()` on an `Err` value: "failed to parse attribute" + +error: proc-macro derive panicked + --> tests/trybuild/invalid-attribute.rs:9:10 + | +9 | #[derive(Get)] + | ^^^ + | + = help: message: called `Result::unwrap()` on an `Err` value: "failed to parse attribute" + +error: proc-macro derive panicked + --> tests/trybuild/invalid-attribute.rs:15:10 + | +15 | #[derive(Get)] + | ^^^ + | + = help: message: called `Result::unwrap()` on an `Err` value: "invalid name value list in attribute" |
