Skip to content

Commit f1ca210

Browse files
committed
Add regression test for issue 309
1 parent 479744e commit f1ca210

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_display.rs

+12
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,18 @@ fn test_field() {
234234
assert("0", Error(Inner { data: 0 }));
235235
}
236236

237+
#[test]
238+
fn test_nested_tuple_field() {
239+
#[derive(Debug)]
240+
struct Inner(usize);
241+
242+
#[derive(Error, Debug)]
243+
#[error("{}", .0.0)]
244+
struct Error(Inner);
245+
246+
assert("0", Error(Inner(0)));
247+
}
248+
237249
#[test]
238250
fn test_macro_rules() {
239251
// Regression test for https://github.com/dtolnay/thiserror/issues/86

0 commit comments

Comments
 (0)