Commit Graph

40 Commits

Author SHA1 Message Date
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
Edwin Groothuis
a2f237f8b7 Add regression tests for the date(1) + argument for user-defined
format strings.

PR:		bin/127514
Submitted by:	edwin@
MFC after:	1 week
2009-05-20 22:01:43 +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
Diomidis Spinellis
990ccb021b Update the number of reported tests to keep prove(1) happy. 2007-12-19 11:52:33 +00:00
Diomidis Spinellis
8990390086 Correct the "move file from directory to existing directory" test for
cross-device moves.
2007-12-19 11:00:22 +00:00
Diomidis Spinellis
381e3dcbea Portability improvements to investigate behavior of other OSs.
Now works under Solaris and Linux.
2007-12-18 08:53:04 +00:00
Diomidis Spinellis
36571ab3b5 Add more tests. All rename(2)-based tests now succeed.
The performance of the cross-device equivalents is under investigation.
2007-12-18 08:49:47 +00:00
Diomidis Spinellis
e08ef41d11 Verify that the moved source is no longer there. 2007-12-16 08:25:34 +00:00
Diomidis Spinellis
67c3750f97 Regression tests for upcoming makeup of mv.
Case 20 corresponds to PR bin/118367.
2007-12-16 08:11:38 +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