Skip to content

Commit 5ccd8a4

Browse files
committed
Adding UI test
1 parent 978c2f1 commit 5ccd8a4

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/ui/invalid_pyclass_args.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,13 @@ struct InvalidOrderedStruct {
7676
inner: i32
7777
}
7878

79+
#[pyclass]
80+
struct Example {
81+
#[pyo3(foo)]
82+
#[pyo3(blah)]
83+
x: i32,
84+
#[pyo3(pop)]
85+
y: i32,
86+
}
87+
7988
fn main() {}

tests/ui/invalid_pyclass_args.stderr

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ error: The `ord` option requires the `eq` option.
8282
74 | #[pyclass(ord)]
8383
| ^^^
8484

85+
error: expected one of: `get`, `set`, `name`
86+
--> tests/ui/invalid_pyclass_args.rs:81:12
87+
|
88+
81 | #[pyo3(foo)]
89+
| ^^^
90+
91+
error: expected one of: `get`, `set`, `name`
92+
--> tests/ui/invalid_pyclass_args.rs:82:12
93+
|
94+
82 | #[pyo3(blah)]
95+
| ^^^^
96+
97+
error: expected one of: `get`, `set`, `name`
98+
--> tests/ui/invalid_pyclass_args.rs:84:12
99+
|
100+
84 | #[pyo3(pop)]
101+
| ^^^
102+
85103
error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
86104
--> tests/ui/invalid_pyclass_args.rs:36:1
87105
|

0 commit comments

Comments
 (0)