Skip to content

Commit e8496a8

Browse files
author
Curtis McEnroe
committed
Test array params
1 parent 5938db2 commit e8496a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/types/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ fn test_hstore_params() {
171171
(None, "NULL")]);
172172
}
173173

174+
#[test]
175+
fn test_array_params() {
176+
test_type("integer[]", &[(Some(vec!(1i32, 2i32)), "ARRAY[1,2]"),
177+
(Some(vec!(1i32)), "ARRAY[1]"),
178+
(Some(vec!()), "ARRAY[]"),
179+
(None, "NULL")]);
180+
}
181+
174182
fn test_nan_param<T: PartialEq+ToSql+FromSql>(sql_type: &str) {
175183
let conn = or_panic!(Connection::connect("postgres://postgres@localhost", SslMode::None));
176184
let stmt = or_panic!(conn.prepare(&*format!("SELECT 'NaN'::{}", sql_type)));

0 commit comments

Comments
 (0)