Skip to content

Commit

Permalink
Add test case for sed on empty file (#904)
Browse files Browse the repository at this point in the history
As discussed as an aside in #900, add test case with an empty file.
  • Loading branch information
wyardley authored and nfischer committed Nov 13, 2018
1 parent 0d5ecb6 commit db317bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Empty file added test/resources/sed/empty.txt
Empty file.
6 changes: 6 additions & 0 deletions test/sed.js
Expand Up @@ -174,3 +174,9 @@ test('glob file names, with in-place-replacement', t => {
t.is(shell.cat(`${t.context.tmp}/file1.txt`).toString(), 'hello1\n');
t.is(shell.cat(`${t.context.tmp}/file2.txt`).toString(), 'hello2\n');
});

test('empty file', t => {
const result = shell.sed('widget', 'wizzle', 'test/resources/sed/empty.txt');
t.is(result.code, 0);
t.is(result.toString(), '');
});

0 comments on commit db317bf

Please sign in to comment.