marking/mark03b
changeset 94 ae4708c851ee
parent 93 21f41e08457d
--- a/marking/mark03b	Wed Dec 21 01:19:25 2016 +0000
+++ b/marking/mark03b	Wed Dec 21 03:06:18 2016 +0000
@@ -38,7 +38,7 @@
 #
 echo "re2.scala does not contain vars, returns etc?" | tee -a $out
 
-if (scala_vars re.scala)
+if (scala_vars re2.scala)
 then
   echo "  --> fail" | tee -a $out
   tsts0=$(( 1 ))
@@ -65,20 +65,48 @@
   tsts1=$(( 1 ))     
 fi
 
-#if [ $tsts1 -eq 0 ]
-#then
-#  echo " nullable(ZERO) == false" | tee -a $out
-#  echo " nullable(ONE) == true" | tee -a $out
-#  
-#  if (scala_assert "re.scala.bak" "../../../marking/re1a_test.scala")
-#  then
-#    echo "  --> success" | tee -a $out
-#    marks=$(( marks + 1 ))
-#  else
-#    echo "  --> test failed" | tee -a $out
-#  fi
-#fi
+if [ $tsts1 -eq 0 ]
+then
+  echo " iterT(200000, (x: Int) => x + 1, 0) == 200000" | tee -a $out
+  echo " iterT(100, (x: BigInt) => x * 2, BigInt(2)) == BigInt(\"2535301200456458802993406410752\")" | tee -a $out
+  echo " iterT(10, (x: String) => x ++ \"a\", \"a\") == \"aaaaaaaaaaa\"" | tee -a $out
+  
+  if (scala_assert "re2.scala" "../../../marking/re2a_test.scala")
+  then
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 2 ))
+  else
+    echo "  --> test failed" | tee -a $out
+  fi
+fi
 
+if [ $tsts1 -eq 0 ]
+then
+  echo " size(iterT(20, (r: Rexp) => der('a', r), EVIL)) == 7340068" | tee -a $out
+  echo " size(iterT(20, (r: Rexp) => simp(der('a', r)), EVIL)) == 8" | tee -a $out
+  
+  if (scala_assert "re2.scala" "../../../marking/re2b_test.scala")
+  then
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 1 ))
+  else
+    echo "  --> test failed" | tee -a $out
+  fi
+fi
+
+if [ $tsts1 -eq 0 ]
+then
+  echo " fixpT((x:Int) => if (200000 < x) x else x + 1, 0) == 200001" | tee -a $out
+  echo " fixpT((x:Long) => if (20 < x) x else x + 1, 0L) == 21L" | tee -a $out
+  
+  if (scala_assert "re2.scala" "../../../marking/re2c_test.scala")
+  then
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 1 ))
+  else
+    echo "  --> test failed" | tee -a $out
+  fi
+fi
 
 ## final marks
 echo "Overall mark for CW 8, Part 2" | tee -a $out