From 1ccc5eb40b8d17160761b31045c306921a49812a Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Mon, 20 Oct 2014 00:21:16 -0400 Subject: [PATCH] Add regression test for #199 --- test/integration/gh-issues/199-tests.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/integration/gh-issues/199-tests.js diff --git a/test/integration/gh-issues/199-tests.js b/test/integration/gh-issues/199-tests.js new file mode 100644 index 0000000..b60477f --- /dev/null +++ b/test/integration/gh-issues/199-tests.js @@ -0,0 +1,21 @@ +var helper = require('../test-helper'); +var client = helper.client(); + +client.query('CREATE TEMP TABLE arrtest (n integer, s varchar)'); +client.query("INSERT INTO arrtest VALUES (4, 'foo'), (5, 'bar'), (6, 'baz');"); + +var qText = "SELECT \ +ARRAY[1, 2, 3] AS b,\ +ARRAY['xx', 'yy', 'zz'] AS c,\ +ARRAY(SELECT n FROM arrtest) AS d,\ +ARRAY(SELECT s FROM arrtest) AS e;"; + +client.query(qText, function(err, result) { + if(err) throw err; + var row = result.rows[0]; + for(var key in row) { + assert.equal(typeof row[key], 'object'); + assert.equal(row[key].length, 3); + } + client.end(); +});