Allow period character as word boundary
This commit is contained in:
parent
ba385868cb
commit
987e02f478
@ -542,10 +542,11 @@ mod tests
|
|||||||
#[test]
|
#[test]
|
||||||
fn parse_compare()
|
fn parse_compare()
|
||||||
{
|
{
|
||||||
assert_eq!(format_formula("X >= 0"), "X >= 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("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]
|
#[test]
|
||||||
|
@ -28,6 +28,7 @@ fn is_character_word_boundary(c: char) -> bool
|
|||||||
| '%'
|
| '%'
|
||||||
| '|'
|
| '|'
|
||||||
| '#'
|
| '#'
|
||||||
|
| '.'
|
||||||
=> true,
|
=> true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ mod tests
|
|||||||
assert!(integer("10000a").is_err());
|
assert!(integer("10000a").is_err());
|
||||||
assert!(integer("+10000a").is_err());
|
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("a").is_err());
|
||||||
assert!(integer("-").is_err());
|
assert!(integer("-").is_err());
|
||||||
assert!(integer(" ").is_err());
|
assert!(integer(" ").is_err());
|
||||||
|
Loading…
Reference in New Issue
Block a user