shithub: MicroHs

Download patch

ref: 94643fd95f33844f874c80b7ca0b71bf7181913d
parent: 4c42805ee9262181d4fc8a6b3a92472353388236
author: Lennart Augustsson <lennart@augustsson.net>
date: Fri Oct 13 09:20:11 EDT 2023

Add error message tests

--- a/TODO
+++ b/TODO
@@ -34,4 +34,3 @@
   - The IORef will need GC support
 * Redo type synonym expansion
   - Only non-injective synonyms necessitate expansion(?)
-* Tests for error messages
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -22,6 +22,7 @@
 	$(MHS) Catch      && $(EVAL) > Catch.out      && diff Catch.ref Catch.out
 	$(MHS) FArith     && $(EVAL) > FArith.out     && diff FArith.ref FArith.out
 	$(MHS) Infix      && $(EVAL) > Infix.out      && diff Infix.ref Infix.out
+	sh errtester.sh < errmsg.test
 
 time:
 	@echo Expect about 10s runtime
--- a/tests/errtester.sh
+++ b/tests/errtester.sh
@@ -34,5 +34,5 @@
     #echo "==="
     #echo "next: $line"
     $comp -i../lib -i../tmp E 2>&1 | sed -e '/CallStack/,$d' > $cerr
-    diff $err $cerr
+    diff $err $cerr || exit 1
 done
--