Skip to content

Commit

Permalink
failing expanded single-op tests for ; and ()
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent f535987 commit 710bb24
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/op.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
var test = require('tape');
var parse = require('../').parse;

test('operators', function (t) {
test('single 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.same(parse('beep;boop'), [ 'beep', { op: ';' }, 'boop' ]);
t.same(parse('(beep;boop)'), [
{ op: '(' }, 'beep', { op: ';' }, 'boop', { op: ')' }
]);

t.end();
});

0 comments on commit 710bb24

Please sign in to comment.