test-context/test-context-macros
Victor Martinez Montané dc77d78608 fix/pattern-matching-breaks-compilation (#4)
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
2026-04-22 17:26:08 +02:00
..
src fix/pattern-matching-breaks-compilation (#4) 2026-04-22 17:26:08 +02:00
Cargo.toml refactor: clean up the macro implementation 2024-02-26 16:03:47 +01:00
CHANGELOG.md chore: update CHANGELOGS 2025-11-04 17:38:55 +01:00