Add tests for attribute parse errors
This commit is contained in:
parent
a3157c9572
commit
e46463e69f
7
test_suite/tests/ui/malformed/cut_off.rs
Normal file
7
test_suite/tests/ui/malformed/cut_off.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use serde_derive::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename =)]
|
||||
struct S;
|
||||
|
||||
fn main() {}
|
5
test_suite/tests/ui/malformed/cut_off.stderr
Normal file
5
test_suite/tests/ui/malformed/cut_off.stderr
Normal file
@ -0,0 +1,5 @@
|
||||
error: unexpected end of input, expected literal
|
||||
--> $DIR/cut_off.rs:4:17
|
||||
|
|
||||
4 | #[serde(rename =)]
|
||||
| ^
|
8
test_suite/tests/ui/malformed/not_list.rs
Normal file
8
test_suite/tests/ui/malformed/not_list.rs
Normal file
@ -0,0 +1,8 @@
|
||||
use serde_derive::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde]
|
||||
#[serde = "?"]
|
||||
struct S;
|
||||
|
||||
fn main() {}
|
11
test_suite/tests/ui/malformed/not_list.stderr
Normal file
11
test_suite/tests/ui/malformed/not_list.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error: expected #[serde(...)]
|
||||
--> $DIR/not_list.rs:4:3
|
||||
|
|
||||
4 | #[serde]
|
||||
| ^^^^^
|
||||
|
||||
error: expected #[serde(...)]
|
||||
--> $DIR/not_list.rs:5:3
|
||||
|
|
||||
5 | #[serde = "?"]
|
||||
| ^^^^^^^^^^^
|
Loading…
x
Reference in New Issue
Block a user