busybox/shell/hush_test/hush-test2/strops2.tests
Denys Vlasenko d2241f5902 shell: better support of [[ ]] bashism
Still rather rudimentary for ash

function                                             old     new   delta
binop                                                433     589    +156
check_operator                                        65     101     +36
done_word                                            736     769     +33
test_main                                            405     418     +13
parse_stream                                        2227    2238     +11
ops_texts                                            124     133      +9
ops_table                                             80      86      +6
run_pipe                                            1557    1562      +5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 8/0 up/down: 269/0)             Total: 269 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-31 03:34:07 +01:00

13 lines
234 B
Plaintext
Executable File

# malformed regex
[[ a =~ * ]]; echo 1:ERR2:$?
[[ a/b =~ a.b ]]; echo 2:YES:$?
[[ a/b =~ /*b ]]; echo 3:YES:$?
v='[]b.-]'
[[ a/.b] =~ $v ]]; echo 4:YES:$?
v=']b.-'
[[ a/.b] =~ $v ]]; echo 5:no:$?
[[ a/.b] =~ [$v] ]]; echo 6:YES:$?