diff --git a/bin/ed/test/README b/bin/ed/test/README index 4512ff73017d..46d41335034c 100644 --- a/bin/ed/test/README +++ b/bin/ed/test/README @@ -1,7 +1,16 @@ The files in this directory with suffixes `.t', `.d', `.r' and `.err' are used for testing ed. To run the tests, set the ED variable in the Makefile for the path name of the program to be tested (e.g., /bin/ed), and type -`make'. The tests do not exhaustively verify POSIX compliance. +`make'. The tests do not exhaustively verify POSIX compliance nor do +they verify correct 8-bit or long line support. + +The test file suffixes have the following meanings: +.t Template - a list of ed commands from which an ed script is + constructed +.d Data - read by an ed script +.r Result - the expected output after processing data via an ed + script. +.err Error - invalid ed commands that should generate an error The output of the tests is written to the two files err.o and scripts.o. At the end of the tests, these files are grep'ed for error messages, diff --git a/bin/ed/test/TODO b/bin/ed/test/TODO new file mode 100644 index 000000000000..6c1f5fb66dd6 --- /dev/null +++ b/bin/ed/test/TODO @@ -0,0 +1,13 @@ +Some missing tests: +0) g/./s^@^@ - okay: NULs in commands +1) g/./s/^@/ - okay: NULs in patterns +2) a + hello^V^Jworld + . - okay: embedded newlines in insert mode +3) ed "" - error: invalid filename +4) red .. - error: restricted +5) red / - error: restricted +5) red !xx - error: restricted +6) ed -x - verify: 8-bit clean +7) ed - verify: long-line support +8) ed - verify: interactive/help mode diff --git a/bin/ed/test/addr1.err b/bin/ed/test/addr1.err new file mode 100644 index 000000000000..29d6383b52c1 --- /dev/null +++ b/bin/ed/test/addr1.err @@ -0,0 +1 @@ +100 diff --git a/bin/ed/test/addr2.err b/bin/ed/test/addr2.err new file mode 100644 index 000000000000..e96acb9254be --- /dev/null +++ b/bin/ed/test/addr2.err @@ -0,0 +1 @@ +-100 diff --git a/bin/ed/test/s10.err b/bin/ed/test/s10.err new file mode 100644 index 000000000000..0d8d83de19ac --- /dev/null +++ b/bin/ed/test/s10.err @@ -0,0 +1,4 @@ +a +hello +. +s/[h[.]/x/ diff --git a/bin/ed/test/s3.d b/bin/ed/test/s3.d new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/bin/ed/test/s3.r b/bin/ed/test/s3.r new file mode 100644 index 000000000000..d6cada2212fd --- /dev/null +++ b/bin/ed/test/s3.r @@ -0,0 +1 @@ +hello world diff --git a/bin/ed/test/s3.t b/bin/ed/test/s3.t new file mode 100644 index 000000000000..fbf880304b7a --- /dev/null +++ b/bin/ed/test/s3.t @@ -0,0 +1,6 @@ +a +hello/[]world +. +s/[/]/ / +s/[[:digit:][]/ / +s/[]]/ / diff --git a/bin/ed/test/s8.err b/bin/ed/test/s8.err new file mode 100644 index 000000000000..5665767c3fa0 --- /dev/null +++ b/bin/ed/test/s8.err @@ -0,0 +1,4 @@ +a +hello +. +s/[h[=]/x/ diff --git a/bin/ed/test/s9.err b/bin/ed/test/s9.err new file mode 100644 index 000000000000..1ff16dd8470f --- /dev/null +++ b/bin/ed/test/s9.err @@ -0,0 +1,4 @@ +a +hello +. +s/[h[:]/x/