1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00

Clean up grammar tests.

This commit is contained in:
Bart Schaefer 2001-03-23 18:59:10 +00:00
parent cb2de78cca
commit fd305eb30a
2 changed files with 35 additions and 26 deletions

@ -1,3 +1,8 @@
2001-03-23 Bart Schaefer <schaefer@zsh.org>
* 13736: Test/01grammar.ztst: Enable more tests as they seem to
work now; add regression test for the fix from 13706.
2001-03-23 Sven Wischnowsky <wischnow@zsh.org> 2001-03-23 Sven Wischnowsky <wischnow@zsh.org>
* 13733: Completion/Builtins/_pids: don't auto-start menu * 13733: Completion/Builtins/_pids: don't auto-start menu

@ -41,9 +41,7 @@
0:Basic subshell list with error 0:Basic subshell list with error
>false >false
# Can someone convince me the following is really supposed to fail { cd /NonExistentDirectory >&/dev/null } || print false
# without the semicolon present?
{ cd /NonExistentDirectory >&/dev/null; } || print false
0:Basic current shell list with error 0:Basic current shell list with error
>false >false
@ -235,17 +233,13 @@
# Tests for `Alternate Forms For Complex Commands' # Tests for `Alternate Forms For Complex Commands'
# #
## I simply can't get these to work. if (true) { print true-1 } elif (true) { print true-2 } else { print false }
## I suspect that the lists which are allowed here are only syntactically if (false) { print true-1 } elif (true) { print true-2 } else { print false }
## special tests. if (false) { print true-1 } elif (false) { print true-2 } else { print false }
# if true; { print true-1; } elif true; { print true-2; } else { false; } 0:Alternate `if' with braces
# if false; { print true-1; } elif true; { print true-2; } else { false; } >true-1
# if false; { print true-1; } elif false; { print true-2; } else { false; } >true-2
#0:Alternate `if' with braces >false
## Are all those semicolons necessary? If not, what are the rules?
#>true-1
#>true-2
#>false
if true; print true if true; print true
0:Short form of `if' 0:Short form of `if'
@ -295,15 +289,25 @@
>Hip hip hooray >Hip hip hooray
>Hip hip hooray >Hip hip hooray
## Why doesn't this one work here? It works from the command line # Why doesn't this one work here? It works from the command line
## or with zsh -fc. # or with zsh -fc.
# case bravo { case bravo {
# (alpha) print schmalpha (alpha) print schmalpha
# ;; ;;
# (bravo) print schmavo (bravo) print schmavo
# ;; ;;
# (charlie) print schmarlie (charlie) print schmarlie
# ;; ;;
# } }
#0:`case' with braces 0:`case' with braces
#>schmavo >schmavo
print 'This test hangs the shell when it fails...' >&8
name=0
# The number 4375 here is chosen to produce more than 16384 bytes of output
while (( name < 4375 )); do
print -n $name
(( name++ ))
done < /dev/null | { read name; print done }
0:Bug regression: `while' loop with redirection and pipeline
>done