Commit graph

156 commits

Author SHA1 Message Date
Max Khon df62aec1a0 Add three execution tests for make(1):
- plus: execute "+command" when run with -jX -n
- ellipsis: ellipsis ("...") from variable
- empty: empty command (from variable)

Currently make(1) fails all three tests:
- plus: segmentation fault due to incorrect command list handling
- ellipsis: works in compat mode but fails in job (-jX) mode
- empty:
        - compat mode: prints error message
	- job mode: works but prints empty string
2011-11-30 05:49:17 +00:00
Jilles Tjoelker 98102dabd3 printf: Allow multibyte characters for '<char> form, avoid negative codes.
Examples:
  LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
  LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.
2011-05-28 11:37:47 +00:00
Jilles Tjoelker e916b99243 sed: Add test for r217133 (-i race).
PR:		bin/153261
MFC after:	2 weeks
2011-01-08 00:06:22 +00:00
Jilles Tjoelker 1c95cbaf9b printf: Test that the "--" option terminator works. 2010-12-08 22:54:18 +00:00
Jilles Tjoelker 88deede54a tr: Fix '[=]=]' equivalence class.
A closing bracket immediately after '[=' should not be treated as special.

Different from the submitted patch, a string ending with '[=' does not cause
access beyond the terminating '\0'.

PR:		bin/150384
Submitted by:	Richard Lowe
MFC after:	2 weeks
2010-09-29 22:24:18 +00:00
Maxim Konovalov 4a509b9cbf o The typo was intended as it stated in the comment. Revert last.
Spotted by:	dfr
2010-06-04 14:22:49 +00:00
Maxim Konovalov 1accefb1e1 o Fix typo: .uudef -> .undef.
PR:		misc/147462
Submitted by:	Erik Cederstrand
2010-06-04 08:14:30 +00:00
Brian Somers 9c24af3d15 Fix stuttering sequences and reverse ranges
PR:		123635
Submitted by:	Ulrich Spörlein, uqs at spoerlein dot net
2010-06-02 07:47:29 +00:00
Edwin Groothuis 531a1a4b2c Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.
2010-03-21 21:33:21 +00:00
Edwin Groothuis 3d7b0d842d Create regression tests for ncal:
- A couple of tests to check if the layout of the generated calenders
  is correct.

- A couple of tests to see if impossible combinations for -3, -A,
  -m, -y etc properly abort.

- A couple of test to confirm that the order of -A, -B, -3 etc give
  the right number of months.
2010-03-14 10:24:03 +00:00
Jaakko Heinonen 12794df244 - Use errx(3) instead of err(3) when checking if snprintf(3) succeeded.
snprintf(3) doesn't set errno in the tested cases.
- If the same argument reference (for example %1) was specified more than
  once, the command didn't necessarily fit to the final command buffer. Fix
  this using a dynamic sbuf buffer. Add a few regression tests for the case.

PR:		bin/95079
No objections:	freebsd-hackers
2010-03-05 15:23:01 +00:00
Ulrich Spörlein 54673381cd Add missing newline in last line of file.
Uncovered via:	fromcvs vs. svn
Approved by:	ed (co-mentor)
2010-02-16 09:10:21 +00:00
Pawel Jakub Dawidek 7b0706f670 - Implement -q option for pgrep(1).
- Add regression test to test -q option.
2010-02-12 18:52:24 +00:00
David E. O'Brien 290dac20e6 Add ability to search up the directory hierarchy for the system directory.
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable.

Reviewed by:	<sjg@NetBSD.org>
Obtained from:	NetBSD (+ embellishment by me, sent back to NetBSD)
2010-01-04 18:57:22 +00:00
David E. O'Brien 19d43a4c5f Fix formatting. 2010-01-04 11:11:37 +00:00
David E. O'Brien 107994f781 There are actually 129 tests here. 2010-01-04 11:00:12 +00:00
David E. O'Brien adcda09cbc Catch up with UNIX98-style PTY's. 2010-01-04 10:59:14 +00:00
David E. O'Brien 41f83263a5 'prove -r' isn't as smart as grog thought. 2010-01-04 10:58:08 +00:00
David E. O'Brien 72cef5b74f You need to be root to run this test. 2010-01-04 09:59:18 +00:00
David E. O'Brien 01d217bcc1 Don't process 'lastcomm' if "AUTOMATED" is defined.
The tests for it require manual setup.
2010-01-04 09:54:24 +00:00
David E. O'Brien 8dcfd5d1d6 It is expected these are chmod +x. 2010-01-04 09:50:30 +00:00
David E. O'Brien faddcb5783 Regression test for r201456. 2010-01-04 09:49:23 +00:00
David E. O'Brien 70ec99bfd2 Provide clean output with 'prove -r'. 2010-01-03 11:53:48 +00:00
Jaakko Heinonen d8eba599f5 Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR:		bin/140976
Submitted by:	D'Arcy Cain (original version) [1]
Approved by:	trasz (mentor)
2009-12-12 18:18:46 +00:00
Diomidis Spinellis ac8f32ce62 IEEE Std 1003.1, 2004 Edition states:
"The escape sequence '\n' shall match a <newline> embedded in
the pattern space."

It is unclear whether this also applies to a \n embedded in a
character class.  Disable the existing handling of \n in a character
class following Mac OS X, GNU sed version 4.1.5 with --posix, and
SunOS 5.10 /usr/bin/sed.

Pointed by:	Marius Strobl
Obtained from:	Mac OS X
2009-09-20 15:47:31 +00:00
Diomidis Spinellis 76570d0a99 Follow POSIX (IEEE Std 1003.1, 2004 Edition) in the implementation
of the y (translate) command.

"If a backslash character is immediately followed by a backslash
character in string1 or string2, the two backslash characters shall
be counted as a single literal backslash character"

Pointed by:	Marius Strobl
Obtained from:	Mac OS X
2009-09-20 15:17:40 +00:00
Diomidis Spinellis 91f8201727 Add correct test results. 2009-09-20 15:04:50 +00:00
Diomidis Spinellis e00741e355 Describe how other systems treat this case. 2009-09-20 14:20:00 +00:00
Diomidis Spinellis 128e6a12b5 Allow [ to be used as a delimiter.
Pointed by:	Marius Strobl
Obtained from:	Apple
2009-09-20 14:11:33 +00:00
Diomidis Spinellis 8d5e165e7f The transition to Subversion allows us to rename files without
repo-copy hacks.
Remove the test-number prefix from the name of the output files,
so that new test cases can be easily added.
2009-09-20 13:39:44 +00:00
Brian Somers 58a654f664 Fix some uninitialise variables.
PR:		136383
Submitted by:	Ulrich Spoerlein - uqs at spoerlein dot net
Approved by:	re (kib)
MFC after:	3 weeks
2009-07-08 10:16:16 +00:00
Brian Somers 258f721bc9 Regression test the 'addr1,+N' feature added in r192732 2009-05-25 06:58:42 +00:00
Robert Watson 76b6a59f9d Rename files that collide on case-insensitive file systems by encoding
colliding upper case letters as the lower case letter with a '_' in
front.

MFC after:	3 days
Discussed with:	ed
Spotted by:	Michael David Crawford <mdc at prgmr.com>
2009-03-10 09:33:22 +00:00
Ed Schouten af65d772a0 Allow jot(1) regression tests to be checked out on Windows filesystems.
The jot(1) regression tests directory contained two tests named `wx' and
`wX', which doesn't work on case insensitive filesystems. Rename `wX' to
`wX1'.

MFC after:	1 month
2009-01-16 15:47:35 +00:00
Diomidis Spinellis b71c319dc6 Add a test for the "or more" part of the following POSIX specification.
"A function can be preceded by one or more '!' characters, in which
  case the function shall be applied if the addresses do not select
  the pattern space."
2008-11-11 17:10:24 +00:00
Giorgos Keramidas f338227f78 Attach the tr(1) regression tests to the build.
Approved by:	das, dds
2008-01-13 08:33:58 +00:00
Giorgos Keramidas 841cbf48eb Add a new set of regression tests, for the tr(1) utility.
Approved by:    das, dds
2008-01-13 08:33:20 +00:00
Diomidis Spinellis 966909fce1 Make the reported number of tests match their actual number.
This fixes the reporting under prove(1)
2007-12-16 08:02:09 +00:00
Diomidis Spinellis 8d40101acd cd to the correct directory so that the tests can be run from prove(1) 2007-12-16 07:55:33 +00:00
Xin LI 68b843a591 Add a test case for sed(1) regression - we should not ignore case
when not being asked to do so.

Approved by:	re (hrs)
2007-07-06 16:36:52 +00:00
Suleiman Souhlal bdd72b703b Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
For example,
	sed /foo/Id
	sed s/foo/bar/Ig

Reviewed by:	dds
Approved by:	re (hrs)
2007-07-04 16:42:41 +00:00
Yaroslav Tykhiy 26a5710c40 Don't forget to clear out the hold space for each subsequent file
when in -i mode so that each file gets a clean context of its own.

Add a regression test for the bug.

Tested with:	regression tests
2007-06-12 12:05:24 +00:00
Greg Lehey df16203833 Updated tests for changed features.
Submitted by: edwin@
2007-06-09 06:01:24 +00:00
Greg Lehey 2b04161236 Use correct comment syntax for $FreeBSD$. This file gets put through
cpp, not a shell script.

Pointy hat to: grog
2007-06-04 01:44:07 +00:00
Greg Lehey 88778e972f Add regression tests for calendar.
Submitted by:	edwin@
PR:		bin/113275
MFC after:	2 weeks
2007-06-03 03:29:32 +00:00
Diomidis Spinellis a14e979ed4 Add sparc64 regression test files.
Submitted by:	Carl Johan Gustavsson
2007-05-24 07:00:53 +00:00
Diomidis Spinellis 2055b9dc4f Modify file generation instructions to remove the tty field:
the mapping from number to name differs between systems,
and will cause tests to fail.
2007-05-24 06:57:50 +00:00
Diomidis Spinellis 550bfecc8f Regression tests for sparc64 record formats.
Submitted by:	Carl Johan Gustavsson
2007-05-22 06:34:20 +00:00
Diomidis Spinellis 6f1544c7f1 Regression tests for amd64 file and record formats.
Submitted by:	Larry Rosenman (who also provided access to a testing host)
2007-05-22 06:30:48 +00:00
Diomidis Spinellis eeec998a23 Regression tests for the new and legacy process accounting formats. 2007-05-22 06:21:20 +00:00