1 var path = require('path')
2 var test = require('tap').test
3 var writeStream = require('../index.js')
5 function repeat (times, string) {
7 for (var ii = 0; ii < times; ++ii) {
13 var target = path.resolve(__dirname, repeat(1000, 'test'))
15 test('name too long', function (t) {
17 var stream = writeStream(target)
19 stream.on('error', function (er) {
21 t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG')
25 stream.on('close', function () {
26 t.ok(hadError, 'got error before close')