Also test empty queries

This commit is contained in:
Steven Fackler 2016-12-22 22:12:04 -05:00
parent 40cba12807
commit 9466dfed2d

View File

@ -133,9 +133,12 @@ fn query() {
})
.and_then(|c| c.prepare("SELECT id, name FROM foo ORDER BY id"))
.and_then(|(s, c)| c.query(&s, &[]).collect())
.map(|(r, _)| {
.and_then(|(r, c)| {
assert_eq!(r[0].get::<String, _>("name"), "joe");
assert_eq!(r[1].get::<String, _>("name"), "bob");
});
c.prepare("")
})
.and_then(|(s, c)| c.query(&s, &[]).collect())
.map(|(r, _)| assert!(r.is_empty()));
l.run(done).unwrap();
}