Skip to content

Commit 1ccc5eb

Browse files
committed
Add regression test for brianc#199
1 parent 41f8712 commit 1ccc5eb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var helper = require('../test-helper');
2+
var client = helper.client();
3+
4+
client.query('CREATE TEMP TABLE arrtest (n integer, s varchar)');
5+
client.query("INSERT INTO arrtest VALUES (4, 'foo'), (5, 'bar'), (6, 'baz');");
6+
7+
var qText = "SELECT \
8+
ARRAY[1, 2, 3] AS b,\
9+
ARRAY['xx', 'yy', 'zz'] AS c,\
10+
ARRAY(SELECT n FROM arrtest) AS d,\
11+
ARRAY(SELECT s FROM arrtest) AS e;";
12+
13+
client.query(qText, function(err, result) {
14+
if(err) throw err;
15+
var row = result.rows[0];
16+
for(var key in row) {
17+
assert.equal(typeof row[key], 'object');
18+
assert.equal(row[key].length, 3);
19+
}
20+
client.end();
21+
});

0 commit comments

Comments
 (0)