Skip to content

Commit f8b37f6

Browse files
committed
identcheck: go back to running two tests for each character
Using a single string would hide a discrepancy if implementations agreed a character was not XID_Start but disagreed about XID_Continue.
1 parent c3268d3 commit f8b37f6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/framework/simple_tests.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ pub fn run_identcheck_subcommand() -> SubcommandStatus {
9999
let mut failures = 0;
100100
let mut model_errors = 0;
101101
for c in char::MIN..=char::MAX {
102-
let input = format!("{c} a{c}");
103-
let rustc = regularised_from_rustc(&input, edition, cleaning, lowering);
104-
let lex_via_peg = regularised_from_peg(&input, edition, cleaning, lowering);
105-
match compare(&rustc, &lex_via_peg) {
106-
Comparison::Agree => passes += 1,
107-
Comparison::Differ => failures += 1,
108-
Comparison::ModelErrors => model_errors += 1,
102+
for input in [format!("{c}"), format!("a{c}")] {
103+
let rustc = regularised_from_rustc(&input, edition, cleaning, lowering);
104+
let lex_via_peg = regularised_from_peg(&input, edition, cleaning, lowering);
105+
match compare(&rustc, &lex_via_peg) {
106+
Comparison::Agree => passes += 1,
107+
Comparison::Differ => failures += 1,
108+
Comparison::ModelErrors => model_errors += 1,
109+
}
109110
}
110111
}
111112
println!("\n{passes} passed, {failures} failed");

0 commit comments

Comments
 (0)