Skip to content

Commit

Permalink
Added test for any anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin committed Mar 19, 2024
1 parent ff47a76 commit e3ec840
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bpaf_derive/src/field_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,3 +947,15 @@ fn raw_literal() {
};
assert_eq!(input.to_token_stream().to_string(), output.to_string());
}

#[test]
fn any_anywhere() {
let input: NamedField = parse_quote! {
#[bpaf(any::<isize>("LIMIT", isize_to_usize), anywhere)]
num: isize
};
let output = quote! {
::bpaf::any::<isize, _, _>("LIMIT", isize_to_usize).anywhere()
};
assert_eq!(input.to_token_stream().to_string(), output.to_string());
}

0 comments on commit e3ec840

Please sign in to comment.