Lines Matching +full:g +full:- +full:link
1 #-
2 # SPDX-License-Identifier: BSD-2-Clause
5 # Copyright (c) 2025 Dag-Erling Smørgrav <des@FreeBSD.org>
34 atf_set "descr" "Verifies that -newer correctly uses a symlink, " \
39 atf_check -s exit:0 mkdir test
40 atf_check -s exit:0 ln -s file1 test/link
41 atf_check -s exit:0 touch -d 2017-12-31T10:00:00Z -h test/link
42 atf_check -s exit:0 touch -d 2017-12-31T11:00:00Z test/file2
43 atf_check -s exit:0 touch -d 2017-12-31T12:00:00Z test/file1
45 # find(1) should evaluate 'link' as a symlink rather than its target
46 # (with -P / without -L flags). Since link was created first, the
48 echo -e "test\ntest/file1\ntest/file2" > expout
49 atf_check -s exit:0 -o save:output find test -newer test/link
50 atf_check -s exit:0 -o file:expout sort < output
56 atf_set "descr" "Verifies that -samefile correctly uses a symlink, " \
61 atf_check -s exit:0 mkdir test
62 atf_check -s exit:0 touch test/file3
63 atf_check -s exit:0 ln -s file3 test/link2
65 # find(1) should evaluate 'link' as a symlink rather than its target
66 # (with -P / without -L flags).
67 atf_check -s exit:0 -o "inline:test/link2\n" find test -samefile test/link2
73 atf_set "descr" "Test the -printf primary"
79 jot -b hello 1024 >dir/file
81 ln -s file dir/link
82 chmod -h 0444 dir/link
83 local db=$(stat -f %b dir)
84 local fb=$(stat -f %b dir/file)
85 local lb=$(stat -f %b dir/link)
88 atf_check -o inline:"dir\ndir/file\ndir/link\n" \
89 find -s dir -printf '%p\n'
90 atf_check -o inline:"dir\nfile\nlink\n" \
91 find -s dir -printf '%f\n'
92 atf_check -o inline:".\ndir\ndir\n" \
93 find -s dir -printf '%h\n'
94 atf_check -s exit:1 -e match:"unimplemented" -o ignore \
95 find -s dir -printf '%P\n'
96 atf_check -s exit:1 -e match:"unimplemented" -o ignore \
97 find -s dir -printf '%H\n'
100 atf_check -o inline:"$(stat -f %Sg dir dir/file dir/link)\n" \
101 find -s dir -printf '%g\n'
102 atf_check -o inline:"$(stat -f %g dir dir/file dir/link)\n" \
103 find -s dir -printf '%G\n'
106 atf_check -o inline:"$(stat -f %Su dir dir/file dir/link)\n" \
107 find -s dir -printf '%u\n'
108 atf_check -o inline:"$(stat -f %u dir dir/file dir/link)\n" \
109 find -s dir -printf '%U\n'
112 atf_check -o inline:"$(stat -f %Lp dir dir/file dir/link)\n" \
113 find -s dir -printf '%m\n'
114 atf_check -o inline:"$(stat -f %Sp dir dir/file dir/link)\n" \
115 find -s dir -printf '%M\n'
118 atf_check -o inline:"$((db/2))\n$((fb/2))\n$((lb/2))\n" \
119 find -s dir -printf '%k\n'
120 atf_check -o inline:"$db\n$fb\n$lb\n" \
121 find -s dir -printf '%b\n'
122 atf_check -o inline:"$(stat -f %z dir dir/file dir/link)\n" \
123 find -s dir -printf '%s\n'
125 atf_check -o ignore \
126 find -s dir -printf '%S\n'
127 atf_check -o inline:"0\n1\n1\n" \
128 find -s dir -printf '%d\n'
131 atf_check -o inline:"$(stat -f %d dir dir/file dir/link)\n" \
132 find -s dir -printf '%D\n'
133 atf_check -s exit:1 -e match:"unimplemented" -o ignore \
134 find -s dir -printf '%F\n'
136 # link target
137 atf_check -o inline:"\n\nfile\n" \
138 find -s dir -printf '%l\n'
141 atf_check -o inline:"$(stat -f %i dir dir/file dir/link)\n" \
142 find -s dir -printf '%i\n'
145 atf_check -o inline:"$(stat -f %l dir dir/file dir/link)\n" \
146 find -s dir -printf '%n\n'
149 atf_check -o inline:"d\nf\nl\n" \
150 find -s dir -printf '%y\n'
151 atf_check -o inline:"d\nf\nf\n" \
152 find -s dir -printf '%Y\n'
155 atf_check -o inline:"$(stat -f %Sa -t '%a %b %e %T %Y' dir dir/file dir/link)\n" \
156 find -s dir -printf '%a\n'
157 atf_check -o inline:"$(stat -f %Sa -t '%e' dir dir/file dir/link)\n" \
158 find -s dir -printf '%Ae\n'
161 atf_check -o inline:"$(stat -f %SB -t '%e' dir dir/file dir/link)\n" \
162 find -s dir -printf '%Be\n'
165 atf_check -o inline:"$(stat -f %Sc -t '%a %b %e %T %Y' dir dir/file dir/link)\n" \
166 find -s dir -printf '%c\n'
167 atf_check -o inline:"$(stat -f %Sc -t '%e' dir dir/file dir/link)\n" \
168 find -s dir -printf '%Ce\n'
171 atf_check -o inline:"$(stat -f %Sm -t '%a %b %e %T %Y' dir dir/file dir/link)\n" \
172 find -s dir -printf '%t\n'
173 atf_check -o inline:"$(stat -f %Sm -t '%e' dir dir/file dir/link)\n" \
174 find -s dir -printf '%Te\n'