Commit Graph

39 Commits

Author SHA1 Message Date
Stefan Farfeleder
80d5dd5fdb Add a test for r199631. 2009-11-21 14:54:35 +00:00
Stefan Farfeleder
ee47d334ef Add a few very basic tests for cd -{L,P} and pwd -{L,P}. 2009-11-21 14:12:51 +00:00
Jilles Tjoelker
7ab07e8ada sh: Allow a newline before "in" in a for command, as required by POSIX. 2009-11-14 22:08:32 +00:00
Jilles Tjoelker
64254a667a sh: Exempt $@ and $* from set -u
This seems more useful and will likely be in the next POSIX standard.

Also document more precisely in the man page what set -u does (note that
$@, $* and $! are the only special parameters that can ever be unset, all
the others are always set, although they may be empty).
2009-10-24 21:20:04 +00:00
Jilles Tjoelker
941538c0f4 Add some tests for ${var?} and set -u. 2009-10-24 20:57:11 +00:00
Jilles Tjoelker
640b70e414 sh: Send the "xyz: not found" message to redirected fd 2.
This also fixes that trying to execute a non-regular file with a command
name without '/' returns 127 instead of 126.
The fix is rather simplistic: treat CMDUNKNOWN as if the command were found
as an external program. The resulting fork is a bit wasteful but executing
unknown commands should not be very frequent.

PR:		bin/137659
2009-10-06 22:00:14 +00:00
Jilles Tjoelker
47e5ae08a1 sh: Disallow mismatched quotes in backticks (...).
Due to the amount of code removed by this, it seems that allowing unmatched
quotes was a deliberate imitation of System V sh and real ksh. Most other
shells do not allow unmatched quotes (e.g. bash, zsh, pdksh, NetBSD /bin/sh,
dash).

PR:		bin/137657
2009-10-01 21:40:08 +00:00
Jilles Tjoelker
e16947f83d sh: Fix crash with empty functions (f() { }) introduced in r196483
Empty pairs of braces are represented by a NULL node pointer, just like
empty lines at the top level.

Support for empty pairs of braces may be removed later. They make the code
more complex, have inconsistent behaviour (may or may not change $?), are
not specified by POSIX and are not allowed by some other shells like bash,
dash and ksh93.

Reported by:	kan
2009-08-28 22:41:25 +00:00
Jilles Tjoelker
840f51bb6d Add some tests for a fixed bug in an uncommitted patch.
(Trying to get syntax errors for sh -c ':; do' and `:; do`.)
2009-08-27 22:23:23 +00:00
Jilles Tjoelker
eb33e843b8 sh: Fix crash when undefining or redefining a currently executing function.
Add a reference count to function definitions.
Memory may leak if multiple SIGINTs arrive in interactive mode,
this will be fixed later by changing SIGINT handling.

PR:		bin/137640
2009-08-23 21:09:46 +00:00
Jilles Tjoelker
886bb28357 Add some tests for r194975 and r194977.
Approved by:	ed (mentor) (implicit)
2009-06-25 17:36:08 +00:00
Jilles Tjoelker
30268dfa3f Designate special builtins as such in command -V and type.
Also document various properties of special builtins that we implement.

Approved by:	ed (mentor) (implicit)
2009-06-24 22:04:04 +00:00
Jilles Tjoelker
97ab37f704 Add test for r190698.
Submitted by:	Eygene Ryabinkin
Approved by:	ed (mentor) (implicit)
2009-06-24 20:22:54 +00:00
Jilles Tjoelker
e2451bddff Add tests for r194774.
Approved by:	ed (mentor) (implicit)
2009-06-23 22:03:56 +00:00
Jilles Tjoelker
57c21ee73a Add tests for r194406 and r194516.
Approved by:	ed (mentor)
2009-06-19 22:15:59 +00:00
Jilles Tjoelker
1251149b3c Add tests for r194127 and r194128.
Approved by:	ed (mentor)
2009-06-14 16:21:51 +00:00
Stefan Farfeleder
912ee8a8a3 Add tests for r193169. 2009-05-31 17:23:27 +00:00
Stefan Farfeleder
c410810eb7 Add a test for r191009. 2009-04-13 19:12:28 +00:00
Stefan Farfeleder
acd5c42915 Test the r190298 change. 2009-03-22 23:00:52 +00:00
Stefan Farfeleder
8b1fa08c95 Add a few tests for the read built-in. 2009-03-22 22:14:46 +00:00
Stefan Farfeleder
d956d1eed5 Update test for r190284. 2009-03-22 21:12:00 +00:00
Stefan Farfeleder
2c93c8f251 Update and extend the tests for alias. 2009-03-22 17:22:14 +00:00
Stefan Farfeleder
b0cb038bc5 Update for 185401, errors now go to stderr. 2008-11-28 18:59:04 +00:00
Stefan Farfeleder
a5e27424dd Add a test for r185231. 2008-11-23 20:27:03 +00:00
Stefan Farfeleder
8d372294f9 Add a test for r182300. 2008-08-27 20:26:34 +00:00
Stefan Farfeleder
58bbcf95ef Add a regression test for r181017.
Submitted by:	simon
2008-07-30 21:18:52 +00:00
Stefan Farfeleder
bf7c82844c Test the expansion of $LINENO. 2008-05-15 19:58:44 +00:00
Stefan Farfeleder
c20ee5ab6d Add a test case for options.c revision 1.26. 2008-03-22 14:07:49 +00:00
Stefan Farfeleder
7cdc70f201 Add a regression test for cd.c's revision 1.35. 2008-02-24 16:52:02 +00:00
Stefan Farfeleder
aafd6a87a6 The exit status of a case statement where none of the patterns is matched
is supposed to be 0, not the status of the previous command.

Reported by:	Eygene Ryabinkin
PR:		116559
Approved by:	re (gnn)
2007-10-04 16:14:48 +00:00
Stefan Farfeleder
9bb8020ab3 Add regression tests for exec.c rev 1.30. 2007-01-11 00:25:20 +00:00
Stefan Farfeleder
44c892dac2 Add regression tests for PR 105078. 2006-11-05 18:41:23 +00:00
Stefan Farfeleder
8af87209e3 Test that variable assignments preceding special built-ins affect the current
shell environment, eg after "VAR=val eval" VAR remains set.  Currently fails
but will be implemented soon.
2006-04-09 09:38:29 +00:00
Stefan Farfeleder
b333fbe98d Add test cases that check utility syntax errors and redirection errors. For
special built-in utilities they must terminate the shell, for other
utilities only a error message shall be written.  We currently fail both
tests.
2006-04-02 19:02:49 +00:00
Stefan Farfeleder
94cfb3d24c Add test cases for the command built-in, including its -v and -V options which
I'll commit real soon.

Count the number of found test cases instead of hard-coding them.  Allow an
arbitrary exit status.
2005-10-28 14:02:42 +00:00
Stefan Farfeleder
e594c724ee - Add tests for hash and return and more tests for set -e.
- Simplify regress.sh, sort tests.
2005-09-05 09:42:10 +00:00
Stefan Farfeleder
7784798d1b Simplify and add PR 77067 which addresses the same bug. 2005-09-04 21:29:09 +00:00
Stefan Farfeleder
e4562fb6e8 Fix syntax error that crept in somehow. 2005-09-04 18:12:21 +00:00
Stefan Farfeleder
afb2e8b616 Add a couple of regression tests for /bin/sh. 2005-09-04 11:59:59 +00:00