mirror of
https://codeberg.org/JasterV/test-context.git
synced 2026-04-26 18:10:06 +00:00
This PR solves the issue identified at https://codeberg.org/JasterV/test-context/issues/2. Previously, when defining the function argument that implements the `TestContext` trait, only "Ident" patterns were accepted (That is, only names). So, the following was valid: ```rust #[test] fn my_test(context: MyContext) {} ``` But the following would throw an error: ```rust #[test] fn my_test(MyContext { n }: MyContext {} ``` With this PR, we are now able to accept any kind of "pattern" such as struct pattern matching, enum pattern matching... etc. We only really care about the "type", and not the "pattern", so this PR makes sure that the "pattern" part of the binding is left untouched. Tests have been added to ensure that destructuring a struct compiles Co-authored-by: JasterV <49537445+JasterV@users.noreply.github.com> Reviewed-on: https://codeberg.org/JasterV/test-context/pulls/4 |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| CHANGELOG.md | ||