Permalink
Browse files

First part of the modify purge is complete: rewrite or remove all tests

that depend on it.
  • Loading branch information...
1 parent 4c8ce71 commit c79fbb4dc4d0e8b0b968025c7102b580d6d0af26 Scott Bronson committed with Scott Bronson Mar 5, 2006
Showing with 85 additions and 343 deletions.
  1. +2 −0 CHANGES
  2. +0 −5 examples/docs/Modify1.test
  3. +0 −7 examples/docs/Modify2.test
  4. +0 −7 examples/docs/Modify3.test
  5. +0 −5 test/{03-results → 02-running}/05-Abort.test
  6. +0 −5 test/{03-results → 02-running}/05-Disable.test
  7. +0 −5 test/{03-results → 02-running}/06-Abort2.test
  8. +0 −5 test/{03-results → 02-running}/06-Disable2.test
  9. +0 −5 test/{03-results → 02-running}/07-Abort3.test
  10. +0 −5 test/{03-results → 02-running}/07-Disable3.test
  11. +0 −5 test/{03-results → 02-running}/08-Abort4.test
  12. +0 −5 test/{03-results → 02-running}/08-Disable4.test
  13. +11 −9 test/02-running/11-Assert.test
  14. +3 −5 test/02-running/13-DisabledDir.test
  15. +2 −4 test/02-running/14-AbortConf.test
  16. +3 −5 test/02-running/15-DisabledDir.test
  17. +7 −5 test/02-running/16-ConfigError.test
  18. +9 −8 test/02-running/17-ConfigError.test
  19. +1 −5 test/02-running/18-TestError.test
  20. +1 −3 test/02-running/21-QuoteFile.test
  21. +0 −27 test/03-results/09-NoNLMod.test
  22. +1 −4 test/03-results/11-NoNLOutput.test
  23. +1 −3 test/03-results/11-NoNLOutput2.test
  24. +0 −14 test/03-results/20-Modify.test
  25. +0 −14 test/03-results/21-Modify.test
  26. +0 −15 test/03-results/22-Modify2.test
  27. +0 −15 test/03-results/23-Modify2.test
  28. +0 −13 test/03-results/24-Modify2.test
  29. +0 −25 test/03-results/25-Modify3.test
  30. +2 −7 test/04-diff/01-Diff.test
  31. +3 −7 test/04-diff/02-MultiDiff.test
  32. +2 −7 test/04-diff/05-AbortDiff.test
  33. +2 −6 test/04-diff/05-DisableDiff.test
  34. +2 −7 test/04-diff/06-AbortDiff2.test
  35. +2 −6 test/04-diff/06-DisableDiff2.test
  36. +2 −7 test/04-diff/07-AbortDiff3.test
  37. +2 −7 test/04-diff/07-DisableDiff3.test
  38. +2 −7 test/04-diff/08-AbortDiff4.test
  39. +2 −7 test/04-diff/08-DisableDiff4.test
  40. +6 −10 test/04-diff/09-MultiLevelDiff.test
  41. +1 −4 test/04-diff/10-Patch.test
  42. +1 −3 test/04-diff/11-MultiPatch.test
  43. +1 −4 test/04-diff/12-MultiLevelPatch.test
  44. +1 −4 test/04-diff/13-MultiLevelPatch.test
  45. +10 −16 test/04-diff/17-ConfigError.test
  46. +3 −1 test/README
View
@@ -1,3 +1,5 @@
+- Got rid of MODIFY clauses. Use INDENT, REPLACE, or sed instead.
+
Released 0.94 on 2 Mar 2006
- NOTE: Bash3 has made it so that the regex can not appear on the same line as
the MODIFY keyword. I updated all tests and accelerated MODIFY deprecation.
@@ -1,5 +0,0 @@
-echo RESULT
-MODIFY:
- s/^(.)/ $1/
-STDOUT:
- RESULT
@@ -1,7 +0,0 @@
-# This is from http://tmtest.berlios.de/wiki/index.php/MODIFY
-
-echo RESULT
-MODIFY:
- s/^RESULT/xRESULT/
-STDOUT:
-xRESULT
@@ -1,7 +0,0 @@
-# This is from http://tmtest.berlios.de/wiki/index.php/MODIFY
-
-date
-MODIFY:
- s/... +... +[0-9]?[0-9] +[0-9]?[0-9]:[0-9][0-9]:[0-9][0-9] +... +20[0-9][0-9]/date date date/
-STDOUT:
-date date date
@@ -13,11 +13,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
ABRT (STDIN)
@@ -13,11 +13,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
dis (STDIN)
@@ -12,11 +12,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDERR:
STDOUT:
ABRT (STDIN) This is the reason
@@ -12,11 +12,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDERR:
STDOUT:
dis (STDIN) This is the reason
@@ -12,11 +12,6 @@ tmtest -q -o - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
ABORT This is the reason
echo "right output"
@@ -12,11 +12,6 @@ tmtest -q -o - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
DISABLED This is the reason
echo "right output"
@@ -18,11 +18,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
ABRT (STDIN)
@@ -18,11 +18,6 @@ tmtest -q - <<-EOL
EOL
-MODIFY:
- s/^\-\-\-.*/--- \/tmp\/STDIN-pid.unique DATE TIME TZ/
- s/^\+\+\+.*/+++ - DATE TIME TZ/
-
-
STDOUT:
dis (STDIN)
@@ -1,20 +1,22 @@
+# Ensure ABORT works.
+#
+# The wrong line number is displayed when the test is fed on stdin
+# as it is here. It's a bash3ism, see BUGS.
+# Furthermore, the filename and line are never even displayed
+# on bash2. Therefore, just wipe the filename and line nuber out
+# completely and this test should pass everywhere.
+
+
cd "$TESTDIR"
-tmtest $CFG -q - <<-EOL
+tmtest $CFG -q - <<-EOL | sed -re "s/ on.*line [0-9]+/ on line LL/"
ASSERT -1 -eq 1
echo it ran
STDOUT:
it ran
EOL
-# The wrong line number is displayed when the test is fed on stdin
-# as it is here. It's a bash3ism, see BUGS.
-# Furthermore, the filename and line are never even displayed
-# on bash2. Therefore, just wipe the filename and line nuber out
-# completely and this test should pass everywhere.
-MODIFY:
- s/ on.*line \d+//
STDOUT:
-ABRT (STDIN) assertion failed: "-1 -eq 1"
+ABRT (STDIN) assertion failed on line LL: "-1 -eq 1"
1 test run, 0 successes, 1 failure.
@@ -19,16 +19,14 @@ cat > t2.test <<-EOs
he
EOs
-tmtest $CFG -q
+tmtest $CFG -q | REPLACE "$dir" /tmp/DIR
rm tmtest.conf t1.test t2.test
-MODIFY:
- s/ by \/.*\/tmtest.conf/ by TMTEST.CONF/
STDOUT:
Processing .
-dis t1.test by TMTEST.CONF
-dis t2.test by TMTEST.CONF
+dis t1.test by /tmp/DIR/tmtest.conf
+dis t2.test by /tmp/DIR/tmtest.conf
2 tests run, 0 successes, 0 failures.
@@ -22,15 +22,13 @@ cat > t2.test <<-EOs
he
EOs
-tmtest $CFG -q
+tmtest $CFG -q | REPLACE "$dir" /tmp/DIR
rm tmtest.conf t1.test t2.test
-MODIFY:
- s/ by \/.*\/tmtest.conf/ by TMTEST.CONF/
STDOUT:
Processing .
-ABRT t1.test by TMTEST.CONF: bail from config
+ABRT t1.test by /tmp/DIR/tmtest.conf: bail from config
1 test run, 0 successes, 1 failure.
@@ -20,16 +20,14 @@ cat > t2.test <<-EOs
he
EOs
-tmtest $CFG -q
+tmtest $CFG -q | REPLACE "$dir" /tmp/DIR
rm tmtest.conf t1.test t2.test
-MODIFY:
- s/ by \/.*\/tmtest.conf/ by TMTEST.CONF/
STDOUT:
Processing .
-dis t1.test by TMTEST.CONF: this is the reason
-dis t2.test by TMTEST.CONF: this is the reason
+dis t1.test by /tmp/DIR/tmtest.conf: this is the reason
+dis t2.test by /tmp/DIR/tmtest.conf: this is the reason
2 tests run, 0 successes, 0 failures.
@@ -1,6 +1,10 @@
# Ensures that even if config files generate errors, tests will
# still try to run. Config file errors go to stderr.
+# TODO: figure out how to rewrite stderr. That may require some
+# assistance from tmtest... After 0.98's streaming changes though.
+# tmtest $CFG -q 2> >( REPLACE "$dir" /tmp/DIR >&2 )
+
MKDIR dir
cd "$dir"
@@ -21,19 +25,17 @@ cat > t2.test <<-EOs
he
EOs
-tmtest $CFG -q
+tmtest $CFG -q 2>&1 | REPLACE "$dir" /tmp/DIR
rm tmtest.conf t1.test t2.test
-MODIFY:
- s/^\/.*\/tmtest.conf/TMTEST.CONF/
STDOUT:
+/tmp/DIR/tmtest.conf: line 2: dotheyspeakbocceonwhat: command not found
+/tmp/DIR/tmtest.conf: line 2: dotheyspeakbocceonwhat: command not found
Processing .
ok t1.test
ok t2.test
2 tests run, 2 successes, 0 failures.
STDERR:
-TMTEST.CONF: line 2: dotheyspeakbocceonwhat: command not found
-TMTEST.CONF: line 2: dotheyspeakbocceonwhat: command not found
@@ -2,6 +2,10 @@
# config files which mark us pedantic. This should preven the
# tests from being run if there are config errors.
+# TODO: this pipes stderr to stdout so it can be rewritten.
+# That's bad news and needs to be fixed.
+
+
MKDIR dir
cd "$dir"
@@ -23,20 +27,17 @@ cat > t2.test <<-EOs
he
EOs
-tmtest $CFG -q
+tmtest $CFG -q 2>&1 | REPLACE "$dir" /tmp/DIR
rm tmtest.conf t1.test t2.test
-MODIFY:
- s/^\/.*\/tmtest.conf/TMTEST.CONF/
- s/ in \/.*\/tmtest.conf/ in TMTEST.CONF/
STDOUT:
+/tmp/DIR/tmtest.conf: line 3: dotheyspeakbocceonwhat: command not found
+/tmp/DIR/tmtest.conf: line 3: dotheyspeakbocceonwhat: command not found
Processing .
-ERR t1.test error in TMTEST.CONF
-ERR t2.test error in TMTEST.CONF
+ERR t1.test error in /tmp/DIR/tmtest.conf
+ERR t2.test error in /tmp/DIR/tmtest.conf
2 tests run, 0 successes, 2 failures.
STDERR:
-TMTEST.CONF: line 3: dotheyspeakbocceonwhat: command not found
-TMTEST.CONF: line 3: dotheyspeakbocceonwhat: command not found
@@ -1,18 +1,14 @@
# Sees what happens when we're in pedantic mode and there's an error
# in the test file.
-tmtest $args -o - <<-EOL
+tmtest $args -o - <<-EOL | sed -re "s/: line [0-9]+:/: line BLAH:/" | INDENT " "
set -e
iusedtobullseyewompratsinmypants
echo it ran
STDOUT:
it ran
EOL
-# stupid bash3 won't allow LINENO=0 to set the proper lineno.
-MODIFY:
- s/: line \d+:/: line BLAH:/
- s/^(\S)/ $1/
STDOUT:
set -e
@@ -16,12 +16,10 @@ cat > '12".test' <<-EOs
hi
EOs
-tmtest $CFG -q
+tmtest $CFG -q | REPLACE "$dir" /tmp/DIR
rm "vl'hurg.test" '12".test'
-MODIFY:
- s/ by \/.*\/tmtest.conf/ by TMTEST.CONF/
STDOUT:
Processing .
@@ -1,27 +0,0 @@
-# Scott Bronson
-# 26 Feb 2006
-#
-# Ensures that a test's stdout need not end in "\n" for the test
-# to pass (see --no-trailing-newline in testfile(5). This adds a
-# modify clause because, alas, using a modify clause changes the
-# code path for the comparison. This is one reason why modify
-# clauses are evil...
-#
-# Also see: 09-NoNL.test
-#
-# (back when we were parsing tests using re2c, lines needed to be
-# less than BUFSIZ and the results always had to end in a newline).
-
-DISABLED "MODIFY won't work here."
-
-tmtest -q - <<-EOL
- echo -n Howdy
- MODIFY:
- s/How/Wen/
- STDOUT: -n
- Wendy
-EOL
-STDOUT:
-ok (STDIN)
-
-1 test run, 1 success, 0 failures.
@@ -9,15 +9,12 @@
# (back when we were parsing tests using re2c, lines needed to be
# less than BUFSIZ and the results always had to end in a newline).
-tmtest -o -q - <<-EOL
+tmtest -o -q - <<-EOL | INDENT " "
echo -n Howdy
STDOUT: -n
Howdy
EOL
-MODIFY:
- s/^(.)/ $1/
-
STDOUT:
echo -n Howdy
STDOUT: -n
@@ -9,14 +9,12 @@
# (back when we were parsing tests using re2c, lines needed to be
# less than BUFSIZ and the results always had to end in a newline).
-tmtest -o -q - <<-EOL
+tmtest -o -q - <<-EOL | INDENT " "
echo -n Howdy
STDOUT: --no-trailing-newline
Howdy
EOL
-MODIFY:
- s/^(.)/ $1/
STDOUT:
echo -n Howdy
@@ -1,14 +0,0 @@
-# Ensures a simple substitution works.
-
-
-tmtest -q - <<-EOL
- echo Howdy
- MODIFY:
- s/Howdy/HOWDY/
- STDOUT :
- HOWDY
-EOL
-STDOUT:
-ok (STDIN)
-
-1 test run, 1 success, 0 failures.
Oops, something went wrong. Retry.

0 comments on commit c79fbb4

Please sign in to comment.