mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-31 07:38:04 +00:00
Use insta to verify values.
This commit is contained in:
parent
d7e2e7361e
commit
8f425e9ce2
9 changed files with 344 additions and 0 deletions
|
@ -1048,4 +1048,28 @@ mod tests {
|
|||
let parse_ast = parse_program(source, "<test>").unwrap();
|
||||
insta::assert_debug_snapshot!(parse_ast);
|
||||
}
|
||||
|
||||
macro_rules! test_aliases_parse {
|
||||
($($name:ident: $alias:expr,)*) => {
|
||||
$(
|
||||
#[test]
|
||||
fn $name() {
|
||||
let source = format!(r#""\N{{{0}}}""#, $alias);
|
||||
let parse_ast = parse_program(&source, "<test>").unwrap();
|
||||
insta::assert_debug_snapshot!(parse_ast);
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
test_aliases_parse! {
|
||||
test_backspace_alias: "BACKSPACE",
|
||||
test_bell_alias: "BEL",
|
||||
test_carriage_return_alias: "CARRIAGE RETURN",
|
||||
test_delete_alias: "DELETE",
|
||||
test_escape_alias: "ESCAPE",
|
||||
test_form_feed_alias: "FORM FEED",
|
||||
test_hts_alias: "HTS",
|
||||
test_character_tabulation_with_justification_alias: "CHARACTER TABULATION WITH JUSTIFICATION",
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue