Skip to content

Commit

Permalink
Adding UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheukting committed Jun 14, 2024
1 parent 978c2f1 commit 5ccd8a4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ui/invalid_pyclass_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,13 @@ struct InvalidOrderedStruct {
inner: i32
}

#[pyclass]
struct Example {
#[pyo3(foo)]
#[pyo3(blah)]
x: i32,
#[pyo3(pop)]
y: i32,
}

fn main() {}
18 changes: 18 additions & 0 deletions tests/ui/invalid_pyclass_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ error: The `ord` option requires the `eq` option.
74 | #[pyclass(ord)]
| ^^^

error: expected one of: `get`, `set`, `name`
--> tests/ui/invalid_pyclass_args.rs:81:12
|
81 | #[pyo3(foo)]
| ^^^

error: expected one of: `get`, `set`, `name`
--> tests/ui/invalid_pyclass_args.rs:82:12
|
82 | #[pyo3(blah)]
| ^^^^

error: expected one of: `get`, `set`, `name`
--> tests/ui/invalid_pyclass_args.rs:84:12
|
84 | #[pyo3(pop)]
| ^^^

error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
--> tests/ui/invalid_pyclass_args.rs:36:1
|
Expand Down

0 comments on commit 5ccd8a4

Please sign in to comment.