Skip to content

Commit

Permalink
Add regression test for issue 309
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 11, 2024
1 parent 479744e commit f1ca210
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ fn test_field() {
assert("0", Error(Inner { data: 0 }));
}

#[test]
fn test_nested_tuple_field() {
#[derive(Debug)]
struct Inner(usize);

#[derive(Error, Debug)]
#[error("{}", .0.0)]
struct Error(Inner);

assert("0", Error(Inner(0)));
}

#[test]
fn test_macro_rules() {
// Regression test for https://github.com/dtolnay/thiserror/issues/86
Expand Down

0 comments on commit f1ca210

Please sign in to comment.