Add test for range queries with integer record IDs

This commit is contained in:
Tobie Morgan Hitchcock 2022-09-04 10:51:26 +01:00
parent 820b49c3d1
commit 0e2b134de2

View file

@ -34,11 +34,21 @@ pub fn range(i: &str) -> IResult<&str, Range> {
},
))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn range_int() {
let sql = "person:1..100";
let res = range(sql);
assert!(res.is_ok());
let out = res.unwrap().1;
assert_eq!(r#"person:1..100"#, format!("{}", out));
}
#[test]
fn range_array() {
let sql = "person:['USA', 10]..['USA', 100]";