File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -367,8 +367,8 @@ SCRIPT
367367 mockfunc=" $( @generate_mock_function_name " ${cmd[@]} " ) "
368368 # stderr name="$name"
369369 # body="function ${mockfunc}() { @debug Running mock : '${cmd[*]}' :; $func; }"
370- declare mockfunc_seq=" ${mockfunc//@ / __} _SEQ"
371- mockfunc_seq=" ${mockfunc_seq// - / __ } "
370+ declare mockfunc_seq=" ${mockfunc// _ / __} _SEQ"
371+ mockfunc_seq=" ${mockfunc_seq// [-\!+.@\[\] \{\} ~] / _ } "
372372 body=" function ${mockfunc} () {
373373 declare -gxi ${mockfunc_seq} =\"\$ {${mockfunc_seq} :-0}\" ;
374374 if bach--is-function \" ${mockfunc} _\$ (( ${mockfunc_seq} + 1))\" ; then
Original file line number Diff line number Diff line change @@ -217,6 +217,16 @@ test-mock-builtin-command-with-external-commands1-assert() {
217217}
218218
219219
220+ test-mock-command-contains-special-characters () {
221+ set -x
222+ @mock ' omg_!@[1]{2}+~.sh'
223+
224+ ' omg_!@[1]{2}+~.sh' --version
225+ }
226+ test-mock-command-contains-special-characters-assert () {
227+ @dryrun ' omg_!@[1]{2}+~.sh' --version
228+ }
229+
220230test-mock-builtin-command-with-external-commands2 () {
221231 @mock command mycmd param1 === @stdout myoutput
222232
You can’t perform that action at this time.
0 commit comments