[Toybox] [PATCH 2/4] sh: add a test for x=${x%y}
Alexander Holler
holler at ahsoftware.de
Sat Nov 5 00:10:28 PDT 2022
---
tests/sh.test | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/sh.test b/tests/sh.test
index 7dd7b00e..984f0928 100644
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -213,6 +213,7 @@ testing '${x#short} ${x##long}' 'x=banana; echo ${x#b*n} ${x##b*n}' \
'ana a\n' '' ''
toyonly testing '${x#utf8}' 'x=aそcde; echo ${x##a?c}' 'de\n' '' ''
testing '${x%y}' 'x=potato; echo ${x%t*o} ${x%%t*o}' 'pota po\n' '' ''
+testing 'x=${x%y}' 'x=potato; x=${x%t*o}; echo $x' 'pota\n' '' ''
testing '${x^y}' 'x=aaaaa; echo ${x^a}' 'Aaaaa\n' '' ''
testing '${x^^y}' 'x=abccdec; echo ${x^^c}; x=abcdec; echo ${x^^c}' \
'abCCdeC\nabCdeC\n' '' ''
--
2.25.1
More information about the Toybox
mailing list