From e8496a81562030c51ddcdeb50504e1e3b5ac7288 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 7 Jul 2016 14:42:45 -0400 Subject: [PATCH] Test array params --- tests/types/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/types/mod.rs b/tests/types/mod.rs index c571b81f..b09623d3 100644 --- a/tests/types/mod.rs +++ b/tests/types/mod.rs @@ -171,6 +171,14 @@ fn test_hstore_params() { (None, "NULL")]); } +#[test] +fn test_array_params() { + test_type("integer[]", &[(Some(vec!(1i32, 2i32)), "ARRAY[1,2]"), + (Some(vec!(1i32)), "ARRAY[1]"), + (Some(vec!()), "ARRAY[]"), + (None, "NULL")]); +} + fn test_nan_param(sql_type: &str) { let conn = or_panic!(Connection::connect("postgres://postgres@localhost", SslMode::None)); let stmt = or_panic!(conn.prepare(&*format!("SELECT 'NaN'::{}", sql_type)));