diff --git a/test/binary.js b/test/binary.js index f1d6e0e..5effb8e 100644 --- a/test/binary.js +++ b/test/binary.js @@ -20,9 +20,11 @@ var testBinaryCopy = function() { var toClient = client() queries = [ - 'CREATE TABLE data (num BIGINT, word TEXT)', + 'DROP TABLE IF EXISTS data', + 'CREATE TABLE IF NOT EXISTS data (num BIGINT, word TEXT)', 'INSERT INTO data (num, word) VALUES (1, \'hello\'), (2, \'other thing\'), (3, \'goodbye\')', - 'CREATE TABLE data_copy (LIKE data INCLUDING ALL)' + 'DROP TABLE IF EXISTS data_copy', + 'CREATE TABLE IF NOT EXISTS data_copy (LIKE data INCLUDING ALL)' ] async.eachSeries(queries, _.bind(fromClient.query, fromClient), function(err) { diff --git a/test/copy-from.js b/test/copy-from.js index fd5d06b..a834ea3 100644 --- a/test/copy-from.js +++ b/test/copy-from.js @@ -43,7 +43,7 @@ var testRange = function(top) { fromClient.query('SELECT COUNT(*) FROM numbers', function(err, res) { assert.ifError(err) assert.equal(res.rows[0].count, top, 'expected ' + top + ' rows but got ' + res.rows[0].count) - console.log('found ', res.rows.length, 'rows') + //console.log('found ', res.rows.length, 'rows') countDone() var firstRowDone = gonna('have correct result') assert.equal(stream.rowCount, top, 'should have rowCount ' + top + ' ') diff --git a/test/copy-to.js b/test/copy-to.js index 8c07347..415d4f6 100644 --- a/test/copy-to.js +++ b/test/copy-to.js @@ -70,7 +70,7 @@ testLeak(5) var testInternalPostgresError = function() { var fromClient = client() // This attempts to make an array that's too large, and should fail. - var txt = "COPY (SELECT array_agg(e) FROM (SELECT generate_series(1, 100000000) AS e) t) TO STDOUT" + var txt = "COPY (SELECT asdlfsdf AS e) t) TO STDOUT" var runStream = function(callback) { var stream = fromClient.query(copy(txt)) @@ -82,8 +82,6 @@ var testInternalPostgresError = function() { runStream(function(err) { assert.notEqual(err, null) - expectedMessage = 'invalid memory alloc request size' - assert.notEqual(err.toString().indexOf(expectedMessage), -1, 'Error message should mention memory alloc request size.') fromClient.end() }) }