* core/cmd: Adjust math commands * shell: make `?x` commands a parsing failure We have moved the `?x` commands to `%x`, thus now no command should start with `?`. This patch makes the parser fail to parse `?x` strings. * core/tui: use APIs in panels * There's no `%q` anymore, use `%=`
177 lines
2.1 KiB
Text
177 lines
2.1 KiB
Text
NAME=newline echo
|
|
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
# The test suite is not allowed to interpret the output!
|
|
echo
|
|
EOF
|
|
EXPECT=<<EOF
|
|
|
|
EOF
|
|
RUN
|
|
|
|
NAME=comments
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
# This is a comment.
|
|
# This is a comment with a ; in it - and it is still only a comment.
|
|
# Other stuff is also ignored: `..` ~ ..
|
|
|
|
# But inside a command line only the commands after the # are ignored.
|
|
%v $$ # this must beignored ; %v $$ | ls
|
|
EOF
|
|
EXPECT=<<EOF
|
|
0x0
|
|
EOF
|
|
RUN
|
|
|
|
NAME=w foo#bar
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
w "foo#bar"
|
|
ps
|
|
EOF
|
|
EXPECT=<<EOF
|
|
foo#bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME="quoted"
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
w "aaaa;bbb@23"
|
|
ps
|
|
EOF
|
|
EXPECT=<<EOF
|
|
aaaa;bbb@23
|
|
EOF
|
|
RUN
|
|
|
|
NAME="quoted"@addr
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
w "aaaa;bbb@23"@ 0x10
|
|
ps @ 0x10
|
|
EOF
|
|
EXPECT=<<EOF
|
|
aaaa;bbb@23
|
|
EOF
|
|
RUN
|
|
|
|
NAME=echo foo; echo bar
|
|
FILE=malloc://1024
|
|
CMDS=echo foo;echo bar
|
|
EXPECT=<<EOF
|
|
foo
|
|
bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME=at3 %vi $$ @ 3; echo bar
|
|
FILE=malloc://1024
|
|
CMDS=%vi $$ @ 3;echo bar
|
|
EXPECT=<<EOF
|
|
3
|
|
bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME=at3 %vi $$ @ 3; echo bar
|
|
FILE=malloc://1024
|
|
CMDS=%vi $$ @ 3; echo bar
|
|
EXPECT=<<EOF
|
|
3
|
|
bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME=%v "1>>>2" ror
|
|
FILE=malloc://1024
|
|
CMDS=%v "1>>>2"
|
|
EXPECT=<<EOF
|
|
0x4000000000000000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=%v "0xdeadbeef<<<40" rol
|
|
FILE=malloc://1024
|
|
CMDS=%v "0xdeadbeef<<<40"
|
|
EXPECT=<<EOF
|
|
0xadbeef00000000de
|
|
EOF
|
|
RUN
|
|
|
|
NAME=echo foo;echo bar
|
|
FILE=malloc://1024
|
|
CMDS=echo foo;echo bar
|
|
EXPECT=<<EOF
|
|
foo
|
|
bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME=;echo bar
|
|
FILE=malloc://1024
|
|
CMDS=;echo bar
|
|
EXPECT=<<EOF
|
|
bar
|
|
EOF
|
|
RUN
|
|
|
|
NAME='>' in cmd: agn "sh->fu"
|
|
FILE==
|
|
CMDS=<<EOF
|
|
agn "sh->fu"
|
|
agg
|
|
EOF
|
|
EXPECT=<<EOF
|
|
.----------.
|
|
| sh->fu |
|
|
`----------'
|
|
EOF
|
|
RUN
|
|
|
|
NAME=multiple '>' in cmd line: echo abc > def>ghi
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo abc > def>ghi # should not hang
|
|
"rm ./def>ghi"
|
|
rm ./ghi
|
|
EOF
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=hash+space in quoted string
|
|
FILE==
|
|
CMDS=<<EOF
|
|
agn "Process form A# B# in cloud"
|
|
agg
|
|
EOF
|
|
EXPECT=<<EOF
|
|
.-------------------------------.
|
|
| Process form A# B# in cloud |
|
|
`-------------------------------'
|
|
EOF
|
|
RUN
|
|
|
|
NAME=cmd outputting trailing space
|
|
FILE==
|
|
CMDS=<<EOF
|
|
# do not convert test to base64
|
|
echo aaa
|
|
echo "bbb "
|
|
echo ccc
|
|
echo "ddd "
|
|
echo eee
|
|
echo "fff "
|
|
EOF
|
|
EXPECT=<<EOF
|
|
aaa
|
|
bbb
|
|
ccc
|
|
ddd
|
|
eee
|
|
fff
|
|
EOF
|
|
RUN
|