Skip to content

Commit

Permalink
[#36] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Orchaldir committed Sep 11, 2023
1 parent 153b2ea commit 471c260
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions macro_ui/tests/parse_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ fn test_complex_enum_with_simple_variant() {
assert_complex_enum(HashMap::from([("complex.type", "C")]), ComplexEnum::C)
}

#[test]
fn test_complex_enum_with_struct() {
assert_complex_enum(
HashMap::from([("complex.type", "D"), ("complex.c", "99")]),
ComplexEnum::D(SimpleStruct { c: 99 }),
)
}

fn assert_simple_enum(text: &str, value: SimpleEnum) {
let parser = MockParser::new(HashMap::from([("test", text)]));

Expand Down

0 comments on commit 471c260

Please sign in to comment.