aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* hush: specially handle [[ - suppress globbing & multiword expansionDenys Vlasenko2009-06-092-0/+26
| | | | | | It's a bashism, but is surprisingly easy to do and costs very little code. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add support for local builtinDenys Vlasenko2009-06-034-0/+29
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush_test: stop mixing tabs/spaces for indentationMike Frysinger2009-06-011-37/+37
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: add support for special vars in bracesMike Frysinger2009-06-016-8/+6
| | | | | | | Some people like to use ${?} rather than $?, so make sure we support all the special single char vars that use this form. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: filter test output to avoid C lib differencesMike Frysinger2009-06-011-0/+4
| | | | | | | | The getopt function in some C libraries wraps the option in single quotes while others do not. Avoid the issue by running sed on the output and strip all quotes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: fix bug 353 (wrong handling of \x in assignments)Denys Vlasenko2009-05-282-0/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make compound.tests executableDenys Vlasenko2009-05-231-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix problems with case in subshells and with "case esac"Denys Vlasenko2009-05-233-7/+18
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush_test: add some pathological compound list testsMike Frysinger2009-05-212-0/+35
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: test for subshell function syntaxMike Frysinger2009-05-212-0/+12
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: add subshelled case testsMike Frysinger2009-05-211-0/+12
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: update test output to match new getopt() outputMike Frysinger2009-05-211-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: ignore generated filesMike Frysinger2009-05-211-0/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* TODO: add someDenys Vlasenko2009-05-131-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add more complex case to leak testcase, fix found breakageDenys Vlasenko2009-05-041-5/+4
| | | | | | | | | | | | | | | | | function old new delta unset_local_var_len - 167 +167 run_list 2350 2457 +107 set_vars_and_save_old - 87 +87 free_pipe 207 227 +20 builtin_unset 220 229 +9 builtin_exit 49 47 -2 free_strings_and_unset 53 - -53 set_vars_all_and_save_old 87 - -87 unset_local_var 168 - -168 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 3/1 up/down: 390/-310) Total: 80 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix bug where in "var=val func" var's value is not visible in funcDenys Vlasenko2009-05-042-2/+0
| | | | | | | | | | | | | | | | | | | function old new delta unset_local_var - 168 +168 set_vars_all_and_save_old - 87 +87 get_ptr_to_local_var - 77 +77 free_strings_and_unset - 53 +53 builtin_export 266 274 +8 get_local_var_value 31 33 +2 putenv_all 27 - -27 free_strings_and_unsetenv 53 - -53 get_local_var 68 - -68 run_list 2475 2350 -125 builtin_unset 380 220 -160 ------------------------------------------------------------------------------ (add/remove: 4/3 grow/shrink: 2/2 up/down: 395/-433) Total: -38 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix \<newline> handlingDenys Vlasenko2009-05-033-0/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix multiple redirections of the same fd (bug 227)Denys Vlasenko2009-05-022-0/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make leak test more robust by unsetting all varsDenis Vlasenko2009-04-261-2/+5
|
* hush: make getopt32 usable in builtins. use it in unset.Denis Vlasenko2009-04-261-3/+2
| | | | | | | | | | more uses are expected in the future. function old new delta getopt32 1356 1393 +37 builtin_export 256 266 +10 builtin_unset 418 380 -38
* hush: nommu fix for function passingDenis Vlasenko2009-04-263-0/+11
|
* hush: fix SEGV in % expansionDenis Vlasenko2009-04-263-3/+5
| | | | | | function old new delta expand_variables 2203 2217 +14
* hush: export -n supportDenis Vlasenko2009-04-202-0/+47
| | | | | | | | function old new delta builtin_export 206 256 +50 set_local_var 248 265 +17 expand_variables 2204 2203 -1
* hush: add two testcasesDenis Vlasenko2009-04-204-0/+23
|
* hush: fix stdin of backgrounded pipe Denis Vlasenko2009-04-202-0/+17
| | | | | | function old new delta run_list 2450 2502 +52
* hush: fix "export not_yet_defined_var", fix parsing of "cmd | }"Denis Vlasenko2009-04-192-0/+3
| | | | | | | | | | corner case; improve hush_leaktool.sh; fix some false positives in testsuite function old new delta builtin_export 191 206 +15 parse_stream 2196 2200 +4
* hush: fix handling of } which is not a closing one in { cmd; }Denis Vlasenko2009-04-195-1/+9
| | | | | | | function old new delta parse_stream 2176 2302 +126 builtin_unset 381 387 +6
* hush: return builtin by Bayram Kurumahmut (kbayram AT ubicom.com)Denis Vlasenko2009-04-172-0/+12
| | | | | ~+200 bytes
* hush: fix "if { echo foo; } then { echo bar; } fi" parsingDenis Vlasenko2009-04-163-1/+22
| | | | | | | function old new delta done_word 728 793 +65 parse_stream 2084 2098 +14
* hush: fix "while...do f1() {a;}; f1; f1 {b;}; f1; done" bugDenis Vlasenko2009-04-111-2/+4
|
* hush: tweak testsDenis Vlasenko2009-04-103-37/+109
|
* hush: add function testsDenis Vlasenko2009-04-106-0/+46
|
* hush: fix some TODOs. TODO in export builting: +250 bytes.Denis Vlasenko2009-04-102-0/+13
| | | | | | | | | | | | | | | | | | simplify unexpected EOF handling. function old new delta builtin_export 117 374 +257 o_reset_to_empty_unquoted - 21 +21 parse_stream 1926 1929 +3 syntax_error_unterm_ch 31 32 +1 handle_dollar 644 641 -3 parse_stream_dquoted 307 298 -9 add_till_backquote 106 97 -9 add_till_closing_paren 303 286 -17 o_reset 21 - -21 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 3/4 up/down: 282/-59) Total: 223 bytes
* hush: tighten up "for" variable name check.Denis Vlasenko2009-04-108-13/+64
| | | | | | | | | | Add TODOs. Disable redir4.right part where we differ from bash. It is not a bug per standards. Add a few tests, one is in hush-bugs section: and_or_and_backgrounding.right. It will likely bite users in real world usage.
* hush: readability improvements.Denis Vlasenko2009-04-104-0/+113
| | | | | | fix some more obscure bugs. a new redir4.tests is known to fail.
* add test cases for parameter substitution with unset/null stringsMike Frysinger2009-04-092-0/+38
|
* hush: deal with some easier TODOsDenis Vlasenko2009-04-094-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta is_well_formed_var_name - 87 +87 builtin_read 49 86 +37 die_if_script - 31 +31 syntax_error_unterminated - 28 +28 syntax_error 26 51 +25 done_word 768 788 +20 syntax_error_at - 12 +12 parse_stream_dquoted 320 328 +8 expand_variables 2064 2063 -1 run_list 1225 1220 -5 add_till_closing_paren 308 303 -5 add_till_backquote 111 106 -5 handle_dollar 812 803 -9 parse_stream 2378 2356 -22 parse_redirect 408 372 -36 maybe_die 44 - -44 is_assignment 215 134 -81 ------------------------------------------------------------------------------ (add/remove: 4/1 grow/shrink: 4/8 up/down: 248/-208) Total: 40 bytes
* hush: plug the leak of expanded heredocDenis Vlasenko2009-04-092-0/+37
|
* hush: fix EXIT trap recursion case; check redirection failuresDenis Vlasenko2009-04-094-0/+28
| | | | | | | | | | | function old new delta run_pipe 1299 1328 +29 hush_exit 90 102 +12 hush_main 1172 1179 +7 run_list 1226 1225 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 48/-1) Total: 47 bytes
* skip some tests when fancy echo support is turned offMike Frysinger2009-04-093-0/+6
|
* we arent testing `echo -n` here so use printf insteadMike Frysinger2009-04-091-6/+6
|
* source the .config so tests can signal they need to be skipped due to ↵Mike Frysinger2009-04-091-2/+11
| | | | feature disable
* hush: more rodust detection of unterminated strings etc;Denis Vlasenko2009-04-086-0/+112
| | | | | | | | | | | | | | | | | fix a case where we forget to copy `cmd` text; optimize nommu heredoc helper by not passing environment to it; add several tests function old new delta add_till_closing_paren 256 308 +52 parse_stream 2337 2378 +41 add_till_backquote 82 111 +29 re_execute_shell 269 284 +15 handle_dollar 802 812 +10 parse_stream_dquoted 316 320 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 151/0) Total: 151 bytes
* expand leak_all1.testsDenis Vlasenko2009-04-081-2/+8
|
* hush: add a leak test which currently failsDenis Vlasenko2009-04-082-0/+44
|
* hush: add leak detector helper; fix/add tests for itDenis Vlasenko2009-04-086-129/+80
| | | | | | | function old new delta builtin_memleak - 92 +92 bltins 288 300 +12
* hush: echo \2>file fixDenis Vlasenko2009-04-086-0/+7
|
* hush: fix heredoc expansion of $var and `cmd`Denis Vlasenko2009-04-074-0/+21
| | | | | | | | | | | | | | function old new delta expand_pseudo_dquoted - 104 +104 setup_heredoc 215 275 +60 done_word 669 691 +22 parse_stream 1899 1902 +3 setup_redirects 196 191 -5 free_pipe 189 183 -6 expand_variables 2349 2229 -120 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/3 up/down: 189/-131) Total: 58 bytes
* use sleep rather than usleepMike Frysinger2009-04-071-2/+4
|
* add a pathological test case for here doc related to eof marker and other ↵Mike Frysinger2009-04-072-0/+17
| | | | ugly corner cases