Skip to content

Commit c0f5266

Browse files
DimitrisJimyouknowone
authored andcommitted
Use insta to verify values.
1 parent 1ca5740 commit c0f5266

9 files changed

+344
-0
lines changed

compiler/parser/src/snapshots/rustpython_parser__string__tests__backspace_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__bell_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__carriage_return_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__character_tabulation_with_justification_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__delete_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__escape_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__form_feed_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__hts_alias.snap

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/string.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,4 +1048,28 @@ mod tests {
10481048
let parse_ast = parse_program(source, "<test>").unwrap();
10491049
insta::assert_debug_snapshot!(parse_ast);
10501050
}
1051+
1052+
macro_rules! test_aliases_parse {
1053+
($($name:ident: $alias:expr,)*) => {
1054+
$(
1055+
#[test]
1056+
fn $name() {
1057+
let source = format!(r#""\N{{{0}}}""#, $alias);
1058+
let parse_ast = parse_program(&source, "<test>").unwrap();
1059+
insta::assert_debug_snapshot!(parse_ast);
1060+
}
1061+
)*
1062+
}
1063+
}
1064+
1065+
test_aliases_parse! {
1066+
test_backspace_alias: "BACKSPACE",
1067+
test_bell_alias: "BEL",
1068+
test_carriage_return_alias: "CARRIAGE RETURN",
1069+
test_delete_alias: "DELETE",
1070+
test_escape_alias: "ESCAPE",
1071+
test_form_feed_alias: "FORM FEED",
1072+
test_hts_alias: "HTS",
1073+
test_character_tabulation_with_justification_alias: "CHARACTER TABULATION WITH JUSTIFICATION",
1074+
}
10511075
}

0 commit comments

Comments
 (0)