Skip to content

Commit 7303550

Browse files
committed
add failing test for #131
1 parent 7a2c428 commit 7303550

File tree

1 file changed

+19
-0
lines changed
  • test/integration/gh-issues

1 file changed

+19
-0
lines changed

test/integration/gh-issues/131.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var helper = require(__dirname + "/../test-helper");
2+
var pg = helper.pg;
3+
4+
test('parsing array results', function() {
5+
pg.connect(helper.config, assert.calls(function(err, client) {
6+
assert.isNull(err);
7+
client.query("CREATE TEMP TABLE why(names text[], numbors integer[], decimals double precision[])");
8+
client.query('INSERT INTO why(names, numbors, decimals) VALUES(\'{"aaron", "brian","a b c" }\', \'{1, 2, 3}\', \'{.1, 0.05, 3.654}\')').on('error', console.log);
9+
test('decimals', function() {
10+
client.query('SELECT decimals FROM why', assert.success(function(result) {
11+
assert.lengthIs(result.rows[0].decimals, 3);
12+
assert.equal(result.rows[0].decimals[0], 0.1);
13+
assert.equal(result.rows[0].decimals[1], 0.05);
14+
assert.equal(result.rows[0].decimals[2], 3.654);
15+
pg.end();
16+
}))
17+
})
18+
}))
19+
})

0 commit comments

Comments
 (0)