aboutsummaryrefslogtreecommitdiff
blob: fdd4346bbe6449b3ffb3b8521c78d015e8a22d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
   Please use git log for copyright holder and year information

   This file is part of libbash.

   libbash is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 2 of the License, or
   (at your option) any later version.

   libbash is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with libbash.  If not, see <http://www.gnu.org/licenses/>.
*/
gunit java_libbash;

command_atom:
"./command" -> (STRING . / command)
"asdf=5 cat" -> (STRING cat) (= asdf (STRING 5))
"i=3 g=4 h=18 grep asdf" -> (STRING grep) (STRING asdf) (= i (STRING 3)) (= g (STRING 4)) (= h (STRING 18))
"./configure --prefix=/usr/local" -> (STRING . / configure) (STRING - - prefix = / usr / local)
//"[[while" -> (STRING [ [ while)
"./foobär" -> (STRING . / foob ä r)
"cat ~/Documents/todo.txt" -> (STRING cat) (STRING ~ / Documents / todo . txt)
"dodir ${foo}/${bar}" -> (STRING dodir) (STRING (VAR_REF foo) / (VAR_REF bar))
"local a=123 b=(1 2 3) c" -> (VARIABLE_DEFINITIONS local (= a (STRING 123)) (= b (ARRAY (STRING 1) (STRING 2) (STRING 3))) (EQUALS c))
"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { })
"echo \"ab#af ###\" #abc" -> (STRING echo) (STRING (DOUBLE_QUOTED_STRING ab # af   # # #))

command:
"asdf=5 cat out.log > result" -> (COMMAND (STRING cat) (STRING out . log) (= asdf (STRING 5)) (REDIR > (STRING result)))
"cat results.log > asdf 2> /dev/null" -> (COMMAND (STRING cat) (STRING results . log) (REDIR > (STRING asdf)) (REDIR 2 > (STRING / dev / null)))
"test-parser a b c" -> (COMMAND (STRING test - parser) (STRING a) (STRING b) (STRING c))