This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.3 KiB
67 lines
2.3 KiB
var test = require('tape'); |
|
var parse = require('../').parse; |
|
|
|
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.same(parse('beep>boop'), [ 'beep', { op: '>' }, 'boop' ]); |
|
t.same(parse('beep 2>boop'), [ 'beep', '2', { op: '>' }, 'boop' ]); |
|
t.same(parse('beep<boop'), [ 'beep', { op: '<' }, 'boop' ]); |
|
|
|
t.end(); |
|
}); |
|
|
|
test('double 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', { op: '||' }, 'boop' ]); |
|
t.same(parse('beep|| boop'), [ 'beep', { op: '||' }, 'boop' ]); |
|
t.same(parse('beep || boop'), [ 'beep', { op: '||' }, 'boop' ]); |
|
|
|
t.same(parse('beep && boop'), [ 'beep', { op: '&&' }, 'boop' ]); |
|
t.same( |
|
parse('beep && boop || byte'), |
|
[ 'beep', { op: '&&' }, 'boop', { op: '||' }, 'byte' ] |
|
); |
|
t.same( |
|
parse('beep&&boop||byte'), |
|
[ 'beep', { op: '&&' }, 'boop', { op: '||' }, 'byte' ] |
|
); |
|
t.same( |
|
parse('beep\\&\\&boop||byte'), |
|
[ 'beep&&boop', { op: '||' }, 'byte' ] |
|
); |
|
t.same( |
|
parse('beep\\&&boop||byte'), |
|
[ 'beep&', { op: '&' }, 'boop', { op: '||' }, 'byte' ] |
|
); |
|
t.same( |
|
parse('beep;;boop|&byte'), |
|
[ 'beep', { op: ';;' }, 'boop', { op: '|&' }, 'byte' ] |
|
); |
|
|
|
t.end(); |
|
}); |
|
|
|
test('glob patterns', function (t) { |
|
t.same( |
|
parse('tap test/*.test.js'), |
|
[ 'tap', { op: 'glob', pattern: 'test/*.test.js' } ] |
|
); |
|
|
|
t.same(parse('tap "test/*.test.js"'), ['tap', 'test/*.test.js']); |
|
t.end(); |
|
})
|
|
|