[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: fix an ls test not to fail when user or group name contai
From: |
Jim Meyering |
Subject: |
[PATCH] tests: fix an ls test not to fail when user or group name contains SP |
Date: |
Mon, 27 May 2013 04:10:56 +0200 |
This avoids a test failure when the current user or group name
contains a space. To demonstrate, you can probably just edit
/etc/group and make your primary group name two words with a
space between them.
>From 909a0561de27e516f3dff8e4a79ce0add5ca148b Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 24 May 2013 20:11:37 -0700
Subject: [PATCH] tests: fix an ls test not to fail when user or group name
contains SP
* tests/ls/block-size.sh (size_etc): The sed expression through which
we filtered the output of "ls -l ..." assumed that the user and group
name components of each line would not contain spaces. Avoid the
problem by using -og instead of -l, thus not printing either of those
fields. Adjust the sed expression accordingly.
---
tests/ls/block-size.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/ls/block-size.sh b/tests/ls/block-size.sh
index 2ae5a0c..25a8c26 100755
--- a/tests/ls/block-size.sh
+++ b/tests/ls/block-size.sh
@@ -30,18 +30,18 @@ for size in 1024 4096 262144; do
done
touch -d '2001-01-01 00:00' file* || fail=1
-size_etc='s/[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'
+size_etc='s/[^ ]* *[^ ]* *//'
-ls -l * | sed "$size_etc" >../out || fail=1
-POSIXLY_CORRECT=1 ls -l * | sed "$size_etc" >>../out || fail=1
-POSIXLY_CORRECT=1 ls -k -l * | sed "$size_etc" >>../out || fail=1
+ls -og * | sed "$size_etc" >../out || fail=1
+POSIXLY_CORRECT=1 ls -og * | sed "$size_etc" >>../out || fail=1
+POSIXLY_CORRECT=1 ls -k -og * | sed "$size_etc" >>../out || fail=1
for var in BLOCKSIZE BLOCK_SIZE LS_BLOCK_SIZE; do
for blocksize in 1 512 1K 1KiB; do
(eval $var=$blocksize && export $var &&
- ls -l * &&
- ls -l -k * &&
- ls -l -k --block-size=$blocksize *
+ ls -og * &&
+ ls -og -k * &&
+ ls -og -k --block-size=$blocksize *
) | sed "$size_etc" >>../out || fail=1
done
done
--
1.8.3
- [PATCH] tests: fix an ls test not to fail when user or group name contains SP,
Jim Meyering <=