From a40c0ebe0165ce59453aea1cd44b45d7c6c661d2 Mon Sep 17 00:00:00 2001 From: Andy C Date: Tue, 31 Dec 2024 13:37:39 -0500 Subject: [PATCH] [spec/assign-extended] Failing test case for shopt -s extdebug and declare -F. This is used in the OSH stdlib! To find the functions in the current file, i.e. for task files. --- doc/ul-table.md | 7 +++++-- spec/assign-extended.test.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/ul-table.md b/doc/ul-table.md index e919f3c20..880a3c81a 100644 --- a/doc/ul-table.md +++ b/doc/ul-table.md @@ -460,8 +460,11 @@ A DOM-based implementation should be much less than 1000 lines. ## Appendix: Real Examples - Docs - - [Guide to Procs and Funcs]($oils-doc:proc-func.html) has a big `ul-table`. + - [Guide to Procs and Funcs](proc-func.html) has a big `ul-table`. Source: [doc/proc-func.md]($oils-src) +- Oils Reference + - [Chapter: Word Language](ref/chap-word-lang.html#op-format) has + tables to document `${x@a}` - Site - [oils.pub Home Page](/) - [Blog Index](/blog/) @@ -472,7 +475,7 @@ I converted the tables in these September posts to `ul-table`: - [After 8 Years, Oils Is Still Small and Flexible](https://www.oilshell.org/blog/2024/09/line-counts.html) - [Garbage Collection Makes YSH Different](https://www.oilshell.org/blog/2024/09/gc.html) - [A Retrospective on the Oils Project](https://www.oilshell.org/blog/2024/09/retrospective.html) -- [Oils 0.22.0 Announcement](https://www.oilshell.org/blog/2024/06/release-0.22.0.html#data-languages) - table of multi-line string litearls +- [Oils 0.22.0 Announcement](https://www.oilshell.org/blog/2024/06/release-0.22.0.html#data-languages) - table of multi-line string literals The markup was much shorter and simpler after conversion! diff --git a/spec/assign-extended.test.sh b/spec/assign-extended.test.sh index 3401ca6d8..0f8d163d7 100644 --- a/spec/assign-extended.test.sh +++ b/spec/assign-extended.test.sh @@ -1,4 +1,5 @@ ## compare_shells: bash-4.4 mksh +## oils_failures_allowed: 1 # Extended assignment language, e.g. typeset, declare, arrays, etc. @@ -78,6 +79,31 @@ declare -f ek ## N-I mksh stdout-json: "" ## N-I mksh status: 127 +#### declare -F with shopt -s extdebug prints more info +case $SH in mksh) exit ;; esac + +source $REPO_ROOT/spec/testdata/bash-source-2.sh + +shopt -s extdebug + +add () { expr 4 + 4; } + +declare -F +echo + +declare -F add +# in bash-source-2 +declare -F g | sed "s;$REPO_ROOT;ROOT;g" + +## STDOUT: +declare -f add +declare -f g + +add 7 main +g 3 ROOT/spec/testdata/bash-source-2.sh +## END +## N-I mksh stdout-json: "" + #### declare -p var (exit status) var1() { echo func; } # function names are NOT found. declare -p var1 var2 >/dev/null