From 10098a83bf8d9e1e21ab8ee1d68c1f912f38e236 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 28 Jan 2019 19:00:29 +0000 Subject: [PATCH] Made the slurp unit test more robust. --- hi | 1 - unit-tests/slurp.sh | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 hi diff --git a/hi b/hi deleted file mode 100644 index cf57f2a..0000000 --- a/hi +++ /dev/null @@ -1 +0,0 @@ -Hello, this is used by `slurp.sh` test, please do not remove. diff --git a/unit-tests/slurp.sh b/unit-tests/slurp.sh index e285988..b389143 100755 --- a/unit-tests/slurp.sh +++ b/unit-tests/slurp.sh @@ -1,11 +1,14 @@ #!/bin/bash -expected='"Hello, this is used by `slurp.sh` test, please do not remove.' -actual=`echo '(slurp (open "hi"))' | target/psse | tail -2 | head -1` +tmp=hi$$ +echo "Hello, there." > ${tmp} +expected='"Hello, there.' +actual=`echo "(slurp (open \"${tmp}\"))" | target/psse | tail -2 | head -1` if [ "${expected}" = "${actual}" ] then echo "OK" + rm ${tmp} exit 0 else echo "Fail: expected '$expected', got '$actual'"