Skip to content

Commit

Permalink
fix: increase _fishtape_test_failed when file is invalid
Browse files Browse the repository at this point in the history
source ./functions/fishtape.fish; fishtape ./tests/invalid.fish

see #60
  • Loading branch information
edouard-lopez committed Jan 24, 2024
1 parent e6e5fc2 commit 5930860
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/fishtape.fish
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function fishtape --description "Test scripts, functions, and plugins in Fish"
echo TAP version 13

for file in $files
fish --init-command=(functions @echo | string collect) --init-command=(functions @test | string collect) $file
fish --init-command=(functions @echo | string collect) --init-command=(functions @test | string collect) $file \
|| set _fishtape_test_failed (math $_fishtape_test_failed + 1)
end

echo
Expand Down
4 changes: 4 additions & 0 deletions tests/invalid.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo === invalid ===

@test "nothing to see here" -z (true)
end # we want to trigger a parsing error

0 comments on commit 5930860

Please sign in to comment.