git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] use 'test ...' instead of '[ ... ]'

From
RHRichard Hansen <rhansen@bbn.com>
Date
Jan 6, 2015, 22:57 UTC
Message-ID
<1420585071-28973-2-git-send-email-rhansen@bbn.com>
In-Reply-To
<1420585071-28973-1-git-send-email-rhansen@bbn.com>
(see Documentation/CodingGuidelines)
Signed-off-by: Richard Hansen <rhansen@bbn.com>
---
 t/test-lib.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9acdc88..3670eed 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -184,10 +184,10 @@ export _x05 _x40 _z40 LF u200c
 # This test checks if command xyzzy does the right thing...
 # '
 # . ./test-lib.sh
-[ "x$ORIGINAL_TERM" != "xdumb" ] && (
+test "x$ORIGINAL_TERM" != "xdumb" && (
 		TERM=$ORIGINAL_TERM &&
 		export TERM &&
-		[ -t 1 ] &&
+		test -t 1 &&
 		tput bold >/dev/null 2>&1 &&
 		tput setaf 1 >/dev/null 2>&1 &&
 		tput sgr0 >/dev/null 2>&1
@@ -684,7 +684,7 @@ test_done () {
 		then
 			error "Can't use skip_all after running some tests"
 		fi
-		[ -z "$skip_all" ] || skip_all=" # SKIP $skip_all"
+		test -z "$skip_all" || skip_all=" # SKIP $skip_all"
 
 		if test $test_external_has_tap -eq 0
 		then
-- 
2.2.1
Previous: Richard HansenNext: Richard Hansen
Message 4 of 5 in “test-lib.sh: do tests for color support after changing HOME”
  1. test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 5, 2015
  2. Junio C HamanoJan 6, 2015
  3. 0/2 test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 6, 2015
  4. 1/2 use 'test ...' instead of '[ ... ]'Richard Hansen, Jan 6, 2015
  5. 2/2 test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 6, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.