From ea3edb5500a056b1cfa088d1c78f58e754689994 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 30 Sep 2018 10:52:40 +0200 Subject: [PATCH] test: add exit in loop test Borrowed from https://github.com/emersion/mrsh/issues/35 --- test/data/loop.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/data/loop.sh b/test/data/loop.sh index 9f4c4fb..2fe905b 100644 --- a/test/data/loop.sh +++ b/test/data/loop.sh @@ -1,5 +1,16 @@ #!/bin/sh -while [ $n -ne 10 ]; do - echo a +n=asdf +echo start +while [ "$n" != "fdsa" ]; do + echo "n: $n" + n="fdsa" + echo "n: $n" +done +echo stop + +# Should exit immediately +while true +do + exit done -- 2.45.2