Skip to content

Commit 01ffa67

Browse files
committed
fix(test): fix subst_word_split_for_loop bash comparison mismatch
Replace filesystem-dependent find command with printf to avoid VFS vs real filesystem mismatch in CI comparison tests. The test still validates word-splitting of command substitution output in for-loop list context.
1 parent 0613763 commit 01ffa67

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crates/bashkit/tests/spec_cases/bash/command-subst.test.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,8 @@ hello"world
155155
156156
### subst_word_split_for_loop
157157
# Command substitution output is word-split in for-loop list context
158-
mkdir -p /src
159-
echo "a" > /src/one.txt
160-
echo "b" > /src/two.txt
161-
echo "c" > /src/three.txt
162158
count=0
163-
for f in $(find /src -name "*.txt" -type f | sort); do
159+
for f in $(printf '/src/one.txt\n/src/two.txt\n/src/three.txt\n'); do
164160
count=$((count + 1))
165161
done
166162
echo "$count"

0 commit comments

Comments
 (0)