builtin_string: extra tests

This commit is contained in:
Andrew Prokhorenkov 2020-06-19 19:54:47 -05:00 committed by ridiculousfish
parent 2b9158ddab
commit efe94344e2

View File

@ -45,12 +45,24 @@ string length -q ""; and echo not zero length; or echo zero length
string pad -l foo
# CHECK: foo
string pad -l -n 2 foo
# CHECK: foo
string pad -r -n 4 -c '-' foo
# CHECK: foo----
string pad --left --right -n 2 -c '=' foo
# CHECK: ==foo==
string pad --left -m 4 -c '=' foo
# CHECK: =foo
string pad --left --right -m 6 --chars '=' foo
# CHECK: ==foo=
string pad --left --right -m 7 --chars '-' bar
# CHECK: --bar--
string sub --length 2 abcde
# CHECK: ab