Mercurial > hg > toybox
comparison tests/du.test @ 1497:f64ca21ed444 draft
Fix du test: du symlink -> "0\tsymlink"
author | Felix Janda <felix.janda@posteo.de> |
---|---|
date | Mon, 22 Sep 2014 08:22:12 -0500 |
parents | 8700cbe1cb29 |
children | a016421051e4 |
comparison
equal
deleted
inserted
replaced
1496:a2796b4cef49 | 1497:f64ca21ed444 |
---|---|
11 mkdir -p du_test/test du_2/foo | 11 mkdir -p du_test/test du_2/foo |
12 testing "du (no options)" "du -k du_test" "4\tdu_test/test\n8\tdu_test\n" "" "" | 12 testing "du (no options)" "du -k du_test" "4\tdu_test/test\n8\tdu_test\n" "" "" |
13 testing "du -s" "du -k -s du_test" "8\tdu_test\n" "" "" | 13 testing "du -s" "du -k -s du_test" "8\tdu_test\n" "" "" |
14 ln -s ../du_2 du_test/xyz | 14 ln -s ../du_2 du_test/xyz |
15 # "du shall count the size of the symbolic link" | 15 # "du shall count the size of the symbolic link" |
16 # I assume this means the space used to store the link name | 16 # The tests assume that like for most POSIX systems symbolic |
17 testing "du counts symlinks without following" "du -ks du_test" "12\tdu_test\n" "" "" | 17 # links are stored directly in the inode so that the |
18 # allocated file space is zero. | |
19 testing "du counts symlinks without following" "du -ks du_test" "8\tdu_test\n" "" "" | |
18 testing "du -L follows symlinks" "du -ksL du_test" "16\tdu_test\n" "" "" | 20 testing "du -L follows symlinks" "du -ksL du_test" "16\tdu_test\n" "" "" |
19 # if -H and -L are specified, the last takes priority | 21 # if -H and -L are specified, the last takes priority |
20 testing "du -HL follows symlinks" "du -ksHL du_test" "16\tdu_test\n" "" "" | 22 testing "du -HL follows symlinks" "du -ksHL du_test" "16\tdu_test\n" "" "" |
21 testing "du -H does not follow unspecified symlinks" "du -ksH du_test" "12\tdu_test\n" "" "" | 23 testing "du -H does not follow unspecified symlinks" "du -ksH du_test" "8\tdu_test\n" "" "" |
22 testing "du -LH does not follow unspecified symlinks" "du -ksLH du_test" "12\tdu_test\n" "" "" | 24 testing "du -LH does not follow unspecified symlinks" "du -ksLH du_test" "8\tdu_test\n" "" "" |
23 testing "du -H follows specified symlinks" "du -ksH du_test/xyz" "8\tdu_test/xyz\n" "" "" | 25 testing "du -H follows specified symlinks" "du -ksH du_test/xyz" "8\tdu_test/xyz\n" "" "" |
24 | 26 |
25 rm -rf du_test du_2 | 27 rm -rf du_test du_2 |
26 | 28 |