<commit_before>var test = require('tap').test,
    ecstatic = require('../lib/ecstatic'),
    http = require('http')
;

test('malformed uri', function (t) {
  t.plan(1);
  var server = http.createServer(ecstatic(__dirname));
  t.on('end', function () {
    server.close();
  });
  
  server.listen(0, function () {
    var r = http.get({
      host: 'localhost',
      port: server.address().port,
      path: '/%'
    });
    r.on('response', function (res) {
      t.equal(res.statusCode, 400);
    });
  });
});<commit_msg>[test] Exit not-so-cleanly when the test/malformed.js server refuses to close<commit_after>var test = require('tap').test,
    ecstatic = require('../lib/ecstatic'),
    http = require('http')
;

var server;

test('malformed uri', function (t) {
  server = http.createServer(ecstatic(__dirname));
  
  server.listen(0, function () {
    var r = http.get({
      host: 'localhost',
      port: server.address().port,
      path: '/%'
    });
    r.on('response', function (res) {
      t.equal(res.statusCode, 400);
      t.end();
    });
  });
});

test('server teardown', function (t) {
  server.close();

  var to = setTimeout(function () {
    process.stderr.write('# server not closing; slaughtering process.\n');
    process.exit(0);
  }, 5000);
  t.end();
});
{'fraction_non_alphanumeric': 0.1967467079783114, 'fraction_numerical': 0.010844306738962044, 'mean_word_length': 3.012422360248447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3991141', 'n_tokens_mistral': 446, 'n_tokens_neox': 430, 'n_words': 90}