Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Dec 4, 2024
1 parent 3b9938b commit aa3dda5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,28 @@ fn test_parse_values_01() {
assert_eq!(parsed.dimensions, 3);
}

#[test]
fn test_parse_values_02() {
let input = quote! {
Something<G, 2> { a: G }
};
let parsed: ParsedValuesInput = parse2(input).unwrap();
assert_eq!(parsed.struct_name, "Something");
assert_eq!(parsed.generic_param, "G");
assert_eq!(parsed.dimensions, 2);
}

#[test]
fn test_parse_values_03() {
let input = quote! {
Something<G, 189_432> { a: G, b: [G; 4] }
};
let parsed: ParsedValuesInput = parse2(input).unwrap();
assert_eq!(parsed.struct_name, "Something");
assert_eq!(parsed.generic_param, "G");
assert_eq!(parsed.dimensions, 189_432);
}

#[test]
fn test_trace_macro_generates_default_row_struct() {
let input = quote! {
Expand Down

0 comments on commit aa3dda5

Please sign in to comment.