diff options
| author | John Turner <jturner.usa@gmail.com> | 2023-04-17 01:01:12 -0400 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2023-04-17 01:01:12 -0400 |
| commit | a6ed66e818416341d94961d848e58c9c948718fa (patch) | |
| tree | 168270c2f7776acd00a207a560998b0ea15c88a1 /tests | |
| parent | 2c0ae15fbe603b1deda2ec12306a0dadb5e6f5a3 (diff) | |
| download | get-a6ed66e818416341d94961d848e58c9c948718fa.tar.gz | |
added test case tuple-struct-without-attribute.rs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/get.rs | 1 | ||||
| -rw-r--r-- | tests/trybuild/tuple-struct-without-attribute.rs | 6 | ||||
| -rw-r--r-- | tests/trybuild/tuple-struct-without-attribute.stderr | 7 |
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/get.rs b/tests/get.rs index 8a61a69..76827ca 100644 --- a/tests/get.rs +++ b/tests/get.rs @@ -44,4 +44,5 @@ fn cat_tuple_struct() { fn trybuild() { let tests = trybuild::TestCases::new(); tests.compile_fail(testcase!("unit-struct.rs")); + tests.compile_fail(testcase!("tuple-struct-without-attribute.rs")); } diff --git a/tests/trybuild/tuple-struct-without-attribute.rs b/tests/trybuild/tuple-struct-without-attribute.rs new file mode 100644 index 0000000..1e40334 --- /dev/null +++ b/tests/trybuild/tuple-struct-without-attribute.rs @@ -0,0 +1,6 @@ +use get::Get; + +#[derive(Get)] +pub struct NewType(u64); + +pub fn main() {} diff --git a/tests/trybuild/tuple-struct-without-attribute.stderr b/tests/trybuild/tuple-struct-without-attribute.stderr new file mode 100644 index 0000000..7ddd8c6 --- /dev/null +++ b/tests/trybuild/tuple-struct-without-attribute.stderr @@ -0,0 +1,7 @@ +error: proc-macro derive panicked + --> tests/trybuild/tuple-struct-without-attribute.rs:3:10 + | +3 | #[derive(Get)] + | ^^^ + | + = help: message: called `Result::unwrap()` on an `Err` value: "tuple fields are required to have an attribute" |
