--- a/main_testing3/re_test.sh Sun May 01 12:41:56 2022 +0100
+++ b/main_testing3/re_test.sh Thu Aug 04 16:53:38 2022 +0200
@@ -25,7 +25,8 @@
# purity test
function scala_vars {
- (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
+ (sed 's/immutable/ok/g' c$out > cb$out;
+ egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
}
@@ -60,7 +61,21 @@
fi
fi
+### make sure datatypes are not tampered with
+if [ $tsts -eq 0 ]
+then
+ echo -e "re.scala has case classes for ALTs and SEQs?" >> $out
+
+ if (scala_assert "re.scala" "re_test0.scala")
+ then
+ echo -e " --> passed" >> $out
+ tsts=$(( 0 ))
+ else
+ echo -e " --> FAIL (make sure the case clases are as given in the template)" >> $out
+ tsts=$(( 1 ))
+ fi
+fi
### re tests