<commit_before>var helper = require(__dirname + "/../test-helper");
var Connection = require(__dirname + "/../../lib/libpq").Connection;

test('calling connect without params raises error', function() {
  var con = new Connection();
  var err;
  try{
    con.connect();
  } catch (e) {
    err = e;
  }
  assert.ok(err!=null);
});

test('connecting with wrong parameters', function() {
  var con = new Connection();
  con.connect("user=asldfkj hostaddr=127.0.0.1 port=5432 dbname=asldkfj");
  assert.emits(con, 'error', function(error) {
    console.log(error);

  })
});


test('connects', function() {
  var con = new Connection();
  con.connect("user=brian hostaddr=127.0.0.1 port=5432 dbname=postgres");
  assert.emits(con, 'connect', function() {
    con._sendQuery("SELECT NOW()");
    test('ends connection', function() {
      con.end();
    })
  });
})<commit_msg>failing test for row results<commit_after>var helper = require(__dirname + "/../test-helper");
var Connection = require(__dirname + "/../../lib/libpq").Connection;

test('calling connect without params raises error', function() {
  var con = new Connection();
  var err;
  try{
    con.connect();
  } catch (e) {
    err = e;
  }
  assert.ok(err!=null);
});

test('connecting with wrong parameters', function() {
  var con = new Connection();
  con.connect("user=asldfkj hostaddr=127.0.0.1 port=5432 dbname=asldkfj");
  assert.emits(con, 'error', function(error) {
    console.log(error);
  });
});


test('connects', function() {
  var con = new Connection();
  con.connect("user=brian hostaddr=127.0.0.1 port=5432 dbname=postgres");
  assert.emits(con, 'connect', function() {
    con._sendQuery("SELECT NOW()");
    assert.emits(con, 'row', function(row) {
      assert.ok(false, "Need to assert on row data");
      test('ends connection', function() {
        con.end();
      });
    });
  });
})
{'fraction_non_alphanumeric': 0.1872, 'fraction_numerical': 0.021333333333333333, 'mean_word_length': 3.761421319796954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4411796', 'n_tokens_mistral': 645, 'n_tokens_neox': 619, 'n_words': 142}