Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: quieter history tests



The history tests involve a certain amount of terminal output as a
side-effect. Using the flusho stty control mode, this can be silenced.
That's the case on most platforms but notably not Linux which doesn't
implement that control. It might have been nicer to do this with
STTY=flusho but that doesn't work. I'm guessing that's because we
redirect stdin so stdin is not a terminal. STTY also don't work for
builtins.

This doesn't appear to affect the tests, whether they pass or fail.

Oliver

diff --git a/Test/W01history.ztst b/Test/W01history.ztst
index 1d3f3cf6f..9a7a40dc8 100644
--- a/Test/W01history.ztst
+++ b/Test/W01history.ztst
@@ -6,18 +6,21 @@
 
 %test
 
+  stty -f /dev/tty flusho
   $ZTST_testdir/../Src/zsh -fis <<<'
   print one two three four five six seven eight nine ten
   print !:$ !:10 !:9 !:1 !:0
   print one two three four five six seven eight nine ten
   print !:0-$ !:1-2
   ' 2>/dev/null
+  stty -f /dev/tty -flusho
 0:History word references
 >one two three four five six seven eight nine ten
 >ten ten nine one print
 >one two three four five six seven eight nine ten
 >print one two three four five six seven eight nine ten one two
 
+  stty -f /dev/tty flusho
   $ZTST_testdir/../Src/zsh -fis <<<'
   print line one of an arbitrary series
   print issue two for some mystery sequence
@@ -26,6 +29,7 @@
   print !2:2
   print !-3:1-$
   ' 2>/dev/null
+  stty -f /dev/tty -flusho
 0:History line numbering
 >line one of an arbitrary series
 >issue two for some mystery sequence
@@ -34,12 +38,14 @@
 >two
 >mystery sequence
 
+  stty -f /dev/tty flusho
   $ZTST_testdir/../Src/zsh -fis <<<'
   print All metaphor, Malachi, stilts and all
   print !1:2:s/,/\\\\?/ !1:2:s/m/shm/:s/,/\!/
   print !1:2:&
   print -l !1:2-3:gs/a/o/
   ' 2>/dev/null
+  stty -f /dev/tty -flusho
 0:History substitution
 >All metaphor, Malachi, stilts and all
 >metaphor? shmetaphor!
@@ -47,10 +53,12 @@
 >metophor,
 >Molochi,
 
+  stty -f /dev/tty flusho
   $ZTST_testdir/../Src/zsh -fis <<<'
   echo foo bar
   echo $(!!) again
   echo more $( !! )' 2>/dev/null
+  stty -f /dev/tty -flusho
 0:Regression test for history references in command substitution
 >foo bar
 >foo bar again
@@ -59,6 +67,7 @@
 F:Check that a history bug introduced by workers/34160 is working again.
 # Discarded line of error output consumes prompts printed by "zsh -i".
 
+ stty -f /dev/tty flusho
  $ZTST_testdir/../Src/zsh -fis <<<'
  echo /my/path/for/testing
  echo !1:1:h10
@@ -70,6 +79,7 @@ F:Check that a history bug introduced by workers/34160 is working again.
  echo !1:1:t2
  echo !1:1:t1
  echo !1:1:t3:h2' 2>/dev/null
+ stty -f /dev/tty -flusho
 0:Modifiers :h and :t with arguments
 >/my/path/for/testing
 >/my/path/for/testing
@@ -82,9 +92,11 @@ F:Check that a history bug introduced by workers/34160 is working again.
 >testing
 >path/for
 
+ stty -f /dev/tty flusho
  $ZTST_testdir/../Src/zsh -fis <<<'
  echo /my/path/for/testing
  echo !1:1:P' 2>/dev/null
+ stty -f /dev/tty -flusho
 0:Modifier :P
 >/my/path/for/testing
 >/my/path/for/testing




Messages sorted by: Reverse Date, Date, Thread, Author