Skip to content

Commit

Permalink
failing test for | and & ops
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent ce51b1f commit d817736
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/op.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var test = require('tape');
var parse = require('../').parse;

test('operators', function (t) {
t.same(parse('beep | boop'), [ 'beep', { op: '|' }, 'boop' ]);
t.same(parse('beep|boop'), [ 'beep', { op: '|' }, 'boop' ]);
t.same(parse('beep \\| boop'), [ 'beep', '|', 'boop' ]);
t.same(parse('beep "|boop"'), [ 'beep', '|boop' ]);
t.same(parse('echo zing &'), [ 'echo', 'zing', { op: '&' } ]);
t.same(parse('echo zing&'), [ 'echo', 'zing', { op: '&' } ]);
t.same(parse('echo zing\\&'), [ 'echo', 'zing&' ]);
t.same(parse('echo "zing\\&"'), [ 'echo', 'zing&' ]);

t.end();
});

0 comments on commit d817736

Please sign in to comment.