ion-rust
ion-rust copied to clipboard
`TextViewBuffer` does not correctly parse macros in structs
Here are the inputs that are currently failing to parse. I did some investigation, and it seems like it is parsing the content just fine, but it is failing somewhere in the raw struct reader/iterator.
use rstest::rstest;
#[rstest]
#[case::e_exp_in_struct("{(:foo)}")]
#[case::e_exp_in_struct_with_space_before("{ (:foo)}")] // FAILS
#[case::e_exp_in_struct_with_space_after("{(:foo) }")]
#[case::e_exp_in_struct_field("{a:(:foo)}")] // FAILS
#[case::e_exp_in_struct_field_with_comma("{a:(:foo),}")] // FAILS
#[case::e_exp_in_struct_field_with_comma_and_second_field("{a:(:foo), b:2}")]
#[case::e_exp_in_struct_field_with_space_before("{ a:(:foo)}")] // FAILS
#[case::e_exp_in_struct_field_with_space_after("{a:(:foo) }")] // FAILS
fn test_match_macro_invocation_in_context(#[case] input: &str) {
MatchTest::new(input).expect_match(match_length(TextBufferView::match_top_level_item_1_1));
}