Skip to content

Commit 10473c8

Browse files
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0e61213 commit 10473c8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/scripts/test-update-example-versions.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,15 @@ test_error_handling() {
232232
cd "$TEST_DIR"
233233
rm -f README.md
234234

235-
# Run script - should warn about missing file but not fail
236-
if bash "$SCRIPT_UNDER_TEST" 2>&1 | grep -q "WARNING: File not found"; then
235+
# Override FILES_TO_UPDATE to include a non-existent file
236+
FILES_TO_UPDATE=("README.md" "nonexistent-file.md") bash "$SCRIPT_UNDER_TEST" 2>&1 | tee /tmp/test-error-output-$$.log
237+
if grep -q "WARNING: File not found" /tmp/test-error-output-$$.log; then
237238
pass "Script handles missing files gracefully"
238239
else
239240
# If no warning, that's also ok as long as script doesn't crash
240241
pass "Script completes even with missing files"
241242
fi
242-
243+
rm -f /tmp/test-error-output-$$.log
243244
cd "$TEST_DIR"
244245
}
245246

0 commit comments

Comments
 (0)