From c30d31e6cd168d0655f2445c2d8f222d954e61a6 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Apr 2024 16:23:25 -0500 Subject: [PATCH] test(parser): Show emoji bug --- crates/toml_edit/tests/testsuite/invalid.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/toml_edit/tests/testsuite/invalid.rs b/crates/toml_edit/tests/testsuite/invalid.rs index 5e7acca0..a156792e 100644 --- a/crates/toml_edit/tests/testsuite/invalid.rs +++ b/crates/toml_edit/tests/testsuite/invalid.rs @@ -209,3 +209,12 @@ dotted key `k1` attempted to extend non-table type (integer) let err = toml_input.parse::().unwrap_err(); snapbox::assert_eq(expected_err, err.to_string()); } + +#[test] +#[should_panic] +fn emoji_error_span() { + let input = "😀"; + let err = input.parse::().unwrap_err(); + dbg!(err.span()); + let _ = &input[err.span().unwrap()]; +}