Skip to content

Commit 3ad8567

Browse files
committed
chore: fix test on macOS
1 parent 1da1cd0 commit 3ad8567

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/lake/tests/cache/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ test_run build -v --no-build test:exe Test:static Test:shared \
180180
test_restored() {
181181
target="$1"; shift
182182
art="$($LAKE query $target)"
183-
hardlinks="$(stat -c %h "$art")"
183+
hardlinks="$(stat_ch "$art")"
184184
echo "! artifact cached (links: $hardlinks): $target -> $art"
185185
test ! "$(norm_dirname "$art")" = "$CACHE_DIR/artifacts"
186186
test $hardlinks -gt 1 # check that the restored artifact is hard linked

tests/lake/tests/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ fi
3131

3232
if [ "$UNAME" = Darwin ] || [ "$UNAME" = FreeBSD ]; then
3333
sed_i() { sed -i '' "$@"; }
34+
stat_ch() { stat -f %l -- "$1"; }
3435
TAIL=gtail
3536
else
3637
sed_i() { sed -i "$@"; }
38+
stat_ch() { stat -c %h -- "$1"; }
3739
TAIL=tail
3840
fi
3941

0 commit comments

Comments
 (0)