mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-24 18:01:37 +08:00
Adds a few more NULL generate_series tests
This commit is contained in:
parent
3a2312e0bd
commit
3c5a9be349
@ -328,13 +328,23 @@ mod test {
|
|||||||
|
|
||||||
let mut s = db.prepare("SELECT * FROM generate_series(NULL)")?;
|
let mut s = db.prepare("SELECT * FROM generate_series(NULL)")?;
|
||||||
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
assert_eq!(Vec::<i32>::new(), series);
|
let empty = Vec::<i32>::new();
|
||||||
|
assert_eq!(empty, series);
|
||||||
let mut s = db.prepare("SELECT * FROM generate_series(5,NULL)")?;
|
let mut s = db.prepare("SELECT * FROM generate_series(5,NULL)")?;
|
||||||
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
assert_eq!(Vec::<i32>::new(), series);
|
assert_eq!(empty, series);
|
||||||
let mut s = db.prepare("SELECT * FROM generate_series(5,10,NULL)")?;
|
let mut s = db.prepare("SELECT * FROM generate_series(5,10,NULL)")?;
|
||||||
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
assert_eq!(Vec::<i32>::new(), series);
|
assert_eq!(empty, series);
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(NULL,10,2)")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(empty, series);
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(5,NULL,2)")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(empty, series);
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(NULL) ORDER BY value DESC")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(empty, series);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user