test: add test for backslash re-addition

This commit is contained in:
electria 2026-09-30 15:30:40 -07:00
commit 396deba4e1
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -54,10 +54,11 @@ pub fn parse_and_calc_humanreadable(mut input: String) -> String {
) )
} }
#[test] #[test]
fn test_equals_readdition() { fn test_character_readdition() {
assert_eq!(parse_and_calc_humanreadable(" = 11".into()), " = 11"); assert_eq!(parse_and_calc_humanreadable(" = 11".into()), " = 11");
assert_eq!(parse_and_calc_humanreadable(" &= 11".into()), " & = 11"); assert_eq!(parse_and_calc_humanreadable(" &= 11".into()), " & = 11");
assert_eq!(parse_and_calc_humanreadable(" & 11".into()), " & 11"); assert_eq!(parse_and_calc_humanreadable(" & 11".into()), " & 11");
assert_eq!(parse_and_calc_humanreadable(" & 11 \\".into()), " & 11 \\");
} }
pub fn parse_and_calc(s: &str) -> Float { pub fn parse_and_calc(s: &str) -> Float {