File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -902,7 +902,7 @@ _shunit_mktempDir() {
902
902
# shellcheck disable=SC2039
903
903
if command [ -r ' /dev/urandom' -a -x ' /usr/bin/od' ]; then
904
904
_shunit_random_=` /usr/bin/od -vAn -N4 -tx4 < /dev/urandom \
905
- | sed ' s/^[^0-9a-f]*//' `
905
+ | command sed ' s/^[^0-9a-f]*//' `
906
906
elif command [ -n " ${RANDOM:- } " ]; then
907
907
# $RANDOM works
908
908
_shunit_random_=${RANDOM}${RANDOM}${RANDOM} $$
@@ -1203,7 +1203,7 @@ _shunit_escapeCharInStr() {
1203
1203
1204
1204
# Escape the character.
1205
1205
# shellcheck disable=SC1003,SC2086
1206
- echo ' ' ${_shunit_s_} ' ' | sed ' s/\' ${_shunit_c_} ' /\\\' ${_shunit_c_} ' /g'
1206
+ echo ' ' ${_shunit_s_} ' ' | command sed ' s/\' ${_shunit_c_} ' /\\\' ${_shunit_c_} ' /g'
1207
1207
1208
1208
unset _shunit_c_ _shunit_s_
1209
1209
}
@@ -1243,7 +1243,7 @@ _shunit_extractTestFunctions() {
1243
1243
_shunit_regex_=' ^\s*((function test[A-Za-z0-9_-]*)|(test[A-Za-z0-9_-]* *\(\)))'
1244
1244
# shellcheck disable=SC2196
1245
1245
egrep " ${_shunit_regex_} " " ${_shunit_script_} " \
1246
- | sed ' s/^[^A-Za-z0-9_-]*//;s/^function //;s/\([A-Za-z0-9_-]*\).*/\1/g' \
1246
+ | command sed ' s/^[^A-Za-z0-9_-]*//;s/^function //;s/\([A-Za-z0-9_-]*\).*/\1/g' \
1247
1247
| xargs
1248
1248
1249
1249
unset _shunit_regex_ _shunit_script_
Original file line number Diff line number Diff line change 249
249
}
250
250
251
251
# Test that certain external commands sometimes "stubbed" by users are escaped.
252
- # See Issue #54.
253
- testProtectedCommands () {
254
- for c in mkdir rm cat chmod; do
252
+ testIssue54 () {
253
+ for c in mkdir rm cat chmod sed; do
255
254
grep " ^[^#]*${c} " " ${TH_SHUNIT} " | grep -qv " command ${c} "
256
255
assertFalse " external call to ${c} not protected somewhere" $?
257
256
done
You can’t perform that action at this time.
0 commit comments