diff --git a/tests/test_display.rs b/tests/test_display.rs index c05d157..7a9057c 100644 --- a/tests/test_display.rs +++ b/tests/test_display.rs @@ -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