Skip to content

Commit 5e6777e

Browse files
authored
update tests not to use regexes
1 parent fb0ef67 commit 5e6777e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/tools/tidy/src/style/tests.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
use super::*;
22

33
#[test]
4-
fn test_generate_problematic_strings() {
5-
let problematic_regex = RegexSet::new(
6-
generate_problematic_strings(
7-
ROOT_PROBLEMATIC_CONSTS,
8-
&[('A', '4'), ('B', '8'), ('E', '3'), ('0', 'F')].iter().cloned().collect(), // use "futile" F intentionally
9-
)
10-
.as_slice(),
11-
)
12-
.unwrap();
13-
assert!(problematic_regex.is_match("786357")); // check with no "decimal" hex digits - converted to integer
14-
assert!(problematic_regex.is_match("589701")); // check with "decimal" replacements - converted to integer
15-
assert!(problematic_regex.is_match("8FF85")); // check for hex display
16-
assert!(!problematic_regex.is_match("1193046")); // check for non-matching value
4+
fn test_contains_problematic_const() {
5+
assert!(contains_problematic_const("786357")); // check with no "decimal" hex digits - converted to integer
6+
assert!(contains_problematic_const("589701")); // check with "decimal" replacements - converted to integer
7+
assert!(contains_problematic_const("8FF85")); // check for hex display
8+
assert!(contains_problematic_const("8fF85")); // check for case-alternating hex display
9+
assert!(!contains_problematic_const("1193046")); // check for non-matching value
1710
}

0 commit comments

Comments
 (0)