Skip to content

Commit 9466dfe

Browse files
committed
Also test empty queries
1 parent 40cba12 commit 9466dfe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

postgres-tokio/src/test.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ fn query() {
133133
})
134134
.and_then(|c| c.prepare("SELECT id, name FROM foo ORDER BY id"))
135135
.and_then(|(s, c)| c.query(&s, &[]).collect())
136-
.map(|(r, _)| {
136+
.and_then(|(r, c)| {
137137
assert_eq!(r[0].get::<String, _>("name"), "joe");
138138
assert_eq!(r[1].get::<String, _>("name"), "bob");
139-
});
139+
c.prepare("")
140+
})
141+
.and_then(|(s, c)| c.query(&s, &[]).collect())
142+
.map(|(r, _)| assert!(r.is_empty()));
140143
l.run(done).unwrap();
141144
}

0 commit comments

Comments
 (0)