From ca11b5edc885a04c041345da8aa39b4abd32a4c9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 15 Oct 2019 22:33:53 -0700 Subject: [PATCH] Add a simple test for SIGINT out of loops --- tests/checks/sigint.fish | 11 +++++++++++ tests/test.fish | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/checks/sigint.fish diff --git a/tests/checks/sigint.fish b/tests/checks/sigint.fish new file mode 100644 index 000000000..07f03b1cd --- /dev/null +++ b/tests/checks/sigint.fish @@ -0,0 +1,11 @@ +#RUN: %fish -C "set helper %fish_test_helper" %s + +# Ensure we can break from a while loop. + +echo About to sigint +$helper sigint_parent & +while true ; end +echo I should not be printed because I got sigint + +#CHECK: About to sigint +#CHECKERR: Sent SIGINT to {{\d*}} diff --git a/tests/test.fish b/tests/test.fish index fc29fb4d2..3ee1da1b5 100644 --- a/tests/test.fish +++ b/tests/test.fish @@ -75,7 +75,10 @@ function test_littlecheck_file set -l file $argv[1] echo -n "Testing file $file ... " set starttime (timestamp) - $python ../littlecheck.py -s fish=../test/root/bin/fish $file + $python ../littlecheck.py \ + -s fish=../test/root/bin/fish \ + -s fish_test_helper=../test/root/bin/fish_test_helper \ + $file set -l exit_status $status set -l res ok set test_duration (delta $starttime)