shithub: MicroHs

Download patch

ref: 14444d50c25f119ede6022d7c545b0bbbbdbf15b
parent: 603d55ac8401d2361873b6ae1b493c4a5579fdcf
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sun Feb 4 06:47:06 EST 2024

Add test for interactive system.

--- a/tests/Makefile
+++ b/tests/Makefile
@@ -3,7 +3,7 @@
 EVAL=../bin/mhseval +RTS -H1M -RTS
 .PHONY: test nfib clean errtest alltest cache info
 
-alltest:	info test errtest
+alltest:	info test errtest interactivetest
 
 cache:
 	rm -f .mhscache
@@ -60,6 +60,9 @@
 
 errtest:
 	sh errtester.sh < errmsg.test
+
+interactivetest:
+	$(TMHS) < itest.in | sed -e '1,/^>/d' > itest.out && diff itest.ref itest.out
 
 nfib:
 	$(TMHS) Nfib && $(EVAL)
--- /dev/null
+++ b/tests/itest.in
@@ -1,0 +1,3 @@
+0
+1+2
+:q
--- /dev/null
+++ b/tests/itest.ref
@@ -1,0 +1,2 @@
+> 3
+> Bye
--