See the attached patch. Now all du tests are passed.

Felix
# HG changeset patch
# User Felix Janda <[email protected]>
# Date 1411230095 -7200
#      Sat Sep 20 18:21:35 2014 +0200
# Node ID edb1ee770843fb2528e42a77d40fbbdbc96e56ca
# Parent  434c4ae19f0559ab3ba6cd3d0a288b44c3c23949
Fix du test: du symlink -> "0\tsymlink"

diff -r 434c4ae19f05 -r edb1ee770843 scripts/test/du.test
--- a/scripts/test/du.test	Thu Sep 18 18:07:58 2014 -0500
+++ b/scripts/test/du.test	Sat Sep 20 18:21:35 2014 +0200
@@ -13,13 +13,15 @@
 testing "du -s" "du -k -s du_test" "8\tdu_test\n" "" ""
 ln -s ../du_2 du_test/xyz
 # "du shall count the size of the symbolic link"
-# I assume this means the space used to store the link name
-testing "du counts symlinks without following" "du -ks du_test" "12\tdu_test\n" "" ""
+# The tests assume that like for most POSIX systems symbolic
+# links are stored directly in the inode so that the
+# allocated file space is zero.
+testing "du counts symlinks without following" "du -ks du_test" "8\tdu_test\n" "" ""
 testing "du -L follows symlinks" "du -ksL du_test" "16\tdu_test\n" "" ""
 # if -H and -L are specified, the last takes priority
 testing "du -HL follows symlinks" "du -ksHL du_test" "16\tdu_test\n" "" ""
-testing "du -H does not follow unspecified symlinks" "du -ksH du_test" "12\tdu_test\n" "" ""
-testing "du -LH does not follow unspecified symlinks" "du -ksLH du_test" "12\tdu_test\n" "" ""
+testing "du -H does not follow unspecified symlinks" "du -ksH du_test" "8\tdu_test\n" "" ""
+testing "du -LH does not follow unspecified symlinks" "du -ksLH du_test" "8\tdu_test\n" "" ""
 testing "du -H follows specified symlinks" "du -ksH du_test/xyz" "8\tdu_test/xyz\n" "" ""
 
 rm -rf du_test du_2
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to