Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160276781
D27984.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27984.id.diff
View Options
diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh
--- a/usr.bin/du/tests/du_test.sh
+++ b/usr.bin/du/tests/du_test.sh
@@ -45,17 +45,25 @@
H_flag_body()
{
local paths1='testdir/A/B testdir/A testdir/C testdir'
- local paths2='testdir/A/B testdir/A testdir/C testdir'
+ local paths2='testdir/C/B testdir/C'
local lineprefix="^[0-9]+$(printf "\t")"
- local sep="\n${lineprefix}"
+ local sep="\$\n${lineprefix}"
atf_check mkdir testdir
atf_check -x "cd testdir && mkdir A && touch A/B && ln -s A C"
atf_check -o save:du.out du -aAH testdir
- atf_check egrep -q "${lineprefix}$(echo $paths1 | sed -e "s/ /$sep/g")" du.out
+ atf_check egrep -q "${lineprefix}$(echo $paths1 | sed -e "s/ /$sep/g")$" du.out
+ # Check that the output doesn't contain any lines (i.e. paths) that we
+ # did not expect it to contain from $paths1.
+ atf_check -s exit:1 egrep -vq "${lineprefix}$(echo $paths1 | sed -e "s/ /$sep/g")$" du.out
+
atf_check -o save:du_C.out du -aAH testdir/C
- atf_check egrep -q "${lineprefix}$(echo $paths2 | sed -e "s/ /$sep/g")" du_C.out
+ atf_check egrep -q "${lineprefix}$(echo $paths2 | sed -e "s/ /$sep/g")$" du_C.out
+
+ # Check that the output doesn't contain any lines (i.e. paths) that we
+ # did not expect it to contain from $paths2.
+ atf_check -s exit:1 egrep -vq "${lineprefix}$(echo $paths2 | sed -e "s/ /$sep/g")$" du_C.out
}
atf_test_case I_flag
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 23, 8:29 PM (12 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34258391
Default Alt Text
D27984.id.diff (1 KB)
Attached To
Mode
D27984: du: tests: make H_flag tests more strict about output requirements
Attached
Detach File
Event Timeline
Log In to Comment