From 5e00c161a66ef5a081adeb5e96c3e949e6a21b7a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 23 Aug 2024 11:13:09 -0500 Subject: [PATCH] test(varcon): Show basic plural parsing --- crates/varcon-core/src/parser.rs | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/crates/varcon-core/src/parser.rs b/crates/varcon-core/src/parser.rs index 5768606..d837d73 100644 --- a/crates/varcon-core/src/parser.rs +++ b/crates/varcon-core/src/parser.rs @@ -1299,6 +1299,54 @@ Entry { comment: None, } +"#]] + ); + } + + #[test] + fn test_plural() { + // Having nothing after `A` causes an incomplete parse. Shouldn't be a problem for my use + // cases. + let (input, actual) = Entry::parse_.parse_peek("_ _-: dogies | \n").unwrap(); + assert_data_eq!( + input, + str![[r#" + + +"#]] + ); + assert_data_eq!( + actual.to_debug(), + str![[r#" +Entry { + variants: [ + Variant { + types: [ + Type { + category: Other, + tag: None, + num: None, + }, + Type { + category: Other, + tag: Some( + Possible, + ), + num: None, + }, + ], + word: "dogies", + }, + ], + pos: None, + archaic: false, + note: false, + description: Some( + "", + ), + comment: None, +} + "#]] ); }