Skip to content

Commit

Permalink
update: added additional test case to increase coverage in match branch
Browse files Browse the repository at this point in the history
  • Loading branch information
MG committed Jul 17, 2024
1 parent 5709b85 commit ba234b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/ui/invalid_pyclass_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ struct StructWithNoMember {
b: String,
}

#[pyclass(str="{}")]
#[derive(Debug)]
struct StructWithNoMember2 {
a: String,
b: String,
}

#[pyclass(eq, str="Stuff...")]
#[derive(Debug, PartialEq)]
pub enum MyEnumInvalidStrFmt {
Expand Down
10 changes: 8 additions & 2 deletions tests/ui/invalid_pyclass_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,16 @@ error: No member found, you must provide a named or positionally specified membe
150 | #[pyclass(str="{:?}")]
| ^^^^^^

error: No member found, you must provide a named or positionally specified member.
--> tests/ui/invalid_pyclass_args.rs:157:15
|
157 | #[pyclass(str="{}")]
| ^^^^

error: string formatter shorthand cannot be used with enums, please implement `Display` or `__str__` directly
--> tests/ui/invalid_pyclass_args.rs:157:19
--> tests/ui/invalid_pyclass_args.rs:164:19
|
157 | #[pyclass(eq, str="Stuff...")]
164 | #[pyclass(eq, str="Stuff...")]
| ^^^^^^^^^^

error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
Expand Down

0 comments on commit ba234b2

Please sign in to comment.