bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] HISTTIMEFORMAT should not be set while running existing histexp.


From: Bradley M. Kuhn
Subject: [PATCH] HISTTIMEFORMAT should not be set while running existing histexp.tests
Date: Sat, 25 Jun 2011 15:04:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Attached please find a small patch that makes sure HISTTIMEFORMAT is not
set when the histexp.tests run.  I use HISTTIMEFORMAT myself, and this
causes the tests to incorrectly fail.  This fix merely unsets it before
the tests are run.  Also fixed are the test output, since the line
numbers changed.

>From 3e0dc8781417fe9b7ba665d1bc3b49fd884ba8b0 Mon Sep 17 00:00:00 2001
From: Bradley M. Kuhn <bkuhn@ebb.org>
Date: Sat, 25 Jun 2011 14:27:12 -0400
Subject: [PATCH] HISTTIMEFORMAT should not be set while running existing 
histexp.tests
 If it is, the test output is not correct.  This change unsets it before
 tests are run.

---
 tests/histexp.right |    2 +-
 tests/histexp.tests |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tests/histexp.right b/tests/histexp.right
index f1c9e9d..dc9a53a 100644
--- a/tests/histexp.right
+++ b/tests/histexp.right
@@ -1,5 +1,5 @@
 echo $BASH_VERSION
-./histexp.tests: line 24: history: !!:z: history expansion failed
+./histexp.tests: line 26: history: !!:z: history expansion failed
     1  for i in one two three; do echo $i; done
     2  /bin/sh -c 'echo this is $0'
     3  ls
diff --git a/tests/histexp.tests b/tests/histexp.tests
index dccbfe0..c813b01 100644
--- a/tests/histexp.tests
+++ b/tests/histexp.tests
@@ -9,6 +9,8 @@ unset HISTFILESIZE
 
 history -c
 
+# unset HISTTIMEFORMAT if it set. Tests below assume it is not set.
+[ "${HISTTIMEFORMAT+set}" = "set" ] && unset HISTTIMEFORMAT
 HISTFILE=history.list
 HISTCONTROL=ignoreboth
 HISTIGNORE='&:#*:history*:fc*'
-- 
1.7.2.5

-- 
   -- bkuhn

reply via email to

[Prev in Thread] Current Thread [Next in Thread]