Allow period character as word boundary

This commit is contained in:
Patrick Lühne 2020-04-20 02:51:46 +02:00
parent ba385868cb
commit 987e02f478
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
3 changed files with 7 additions and 5 deletions

View File

@ -542,10 +542,11 @@ mod tests
#[test]
fn parse_compare()
{
assert_eq!(format_formula("X >= 0"), "X >= 0");
assert_eq!(format_formula("N >= 0"), "N >= 0");
assert_eq!(format_formula("n < 0"), "n < 0");
assert_eq!(format_formula("n >= 0"), "n >= 0");
assert_eq!(format_formula("X>=0."), "X >= 0");
assert_eq!(format_formula("N>=0."), "N >= 0");
assert_eq!(format_formula("n<0."), "n < 0");
assert_eq!(format_formula("n>=0."), "n >= 0");
assert_eq!(format_formula("p(0)>=q."), "p(0) >= q");
}
#[test]

View File

@ -28,6 +28,7 @@ fn is_character_word_boundary(c: char) -> bool
| '%'
| '|'
| '#'
| '.'
=> true,
_ => false,
}

View File

@ -185,7 +185,7 @@ mod tests
assert!(integer("10000a").is_err());
assert!(integer("+10000a").is_err());
assert!(integer("-10000a").is_err());
assert!(integer("1.5").is_err());
assert_eq!(integer("1.5"), Ok((".5", 1)));
assert!(integer("a").is_err());
assert!(integer("-").is_err());
assert!(integer(" ").is_err());