Permalink
Browse files

Add test for ${FUNCNAME[@]}

  • Loading branch information...
Andy Chu
Andy Chu committed Aug 10, 2017
1 parent 2b43fd5 commit a5c107a34540a8340dc1fbe29327664bad522463
Showing with 25 additions and 0 deletions.
  1. +19 −0 spec/introspect.test.sh
  2. +6 −0 test/spec.sh
View
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# TODO:
# BASH_SOURCE, BASH_LINENO, caller builtin
### ${FUNCNAME[@]} array
f() {
echo "begin: ${FUNCNAME[@]}"
g
echo "end: ${FUNCNAME[@]}"
}
g() {
echo "func: ${FUNCNAME[@]}"
}
f
# stdout-json: "begin: f\nfunc: g f\nend: f\n"
# N-I mksh stdout-json: "begin: \nfunc: \nend: \n"
# N-I dash stdout-json: ""
# N-I dash status: 2
View
@@ -331,6 +331,12 @@ special-vars() {
${REF_SHELLS[@]} $OSH "$@"
}
# dash/mksh don't implement this.
introspect() {
sh-spec spec/introspect.test.sh --osh-failures-allowed 1 \
$BASH $OSH "$@"
}
# DONE -- pysh is the most conformant!
tilde() {
sh-spec spec/tilde.test.sh ${REF_SHELLS[@]} $OSH "$@"

0 comments on commit a5c107a

Please sign in to comment.