Made the slurp unit test more robust.

This commit is contained in:
Simon Brooke 2019-01-28 19:00:29 +00:00
parent 3618368f63
commit 10098a83bf
2 changed files with 5 additions and 3 deletions

1
hi
View file

@ -1 +0,0 @@
Hello, this is used by `slurp.sh` test, please do not remove.

View file

@ -1,11 +1,14 @@
#!/bin/bash #!/bin/bash
expected='"Hello, this is used by `slurp.sh` test, please do not remove.' tmp=hi$$
actual=`echo '(slurp (open "hi"))' | target/psse | tail -2 | head -1` echo "Hello, there." > ${tmp}
expected='"Hello, there.'
actual=`echo "(slurp (open \"${tmp}\"))" | target/psse | tail -2 | head -1`
if [ "${expected}" = "${actual}" ] if [ "${expected}" = "${actual}" ]
then then
echo "OK" echo "OK"
rm ${tmp}
exit 0 exit 0
else else
echo "Fail: expected '$expected', got '$actual'" echo "Fail: expected '$expected', got '$actual'"