-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
failing expanded single-op tests for ; and ()
- Loading branch information
James Halliday
committed
May 13, 2013
1 parent
f535987
commit 710bb24
Showing
1 changed file
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |