marking/mark02b
changeset 102 085bf16963c6
parent 98 8f03f0dc3065
child 125 dcaab8068baa
--- a/marking/mark02b	Wed Jan 11 14:46:37 2017 +0000
+++ b/marking/mark02b	Wed Jan 11 14:56:16 2017 +0000
@@ -26,7 +26,7 @@
 # functional tests
 
 function scala_assert {
-  (scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
+  (scala -i "$1" "$2" -e "") # 2> /dev/null 1> /dev/null)
 }
 
 
@@ -65,12 +65,11 @@
   tsts1=$(( 1 ))     
 fi
 
-
 if [ $tsts1 -eq 0 ]
 then
-  echo " ordered_moves(8, List((3,4), (3,2)), (1,3)) == (0,1), (0,5), (2,1), (2,5)" | tee -a $out
-  echo " ordered_moves(8, List((4,0)), (0,0)) == (2,1), (1,2)" | tee -a $out
-  echo " ordered_moves(8, List((0,4)), (0,0)) == (1,2), (2,1)" | tee -a $out
+  echo " ordered_moves(8, List((3,4), (3,2)), (1, 3)) == List((0,1), (0,5), (2,1), (2,5))" | tee -a $out
+  echo " ordered_moves(8, List((4,0)), (0,0)) == List((2,1), (1,2))" | tee -a $out
+  echo " ordered_moves(8, List((0,4)), (0,0)) == List((1,2), (2,1))" | tee -a $out
   
   if (scala_assert "knight3.scala.bak" "../../../marking/knight3a_test.scala")
   then
@@ -83,7 +82,7 @@
 
 if [ $tsts1 -eq 0 ]
 then
-  echo " first_closed_tour_heuristic(6, List((3, 3))) is ok?" | tee -a $out
+  echo " first_closed_tour_heuristic(6, List((3, 3))) found and ok?" | tee -a $out
   
   if (scala_assert "knight3.scala.bak" "../../../marking/knight3b_test.scala")
   then
@@ -94,6 +93,20 @@
   fi
 fi
 
+if [ $tsts1 -eq 0 ]
+then
+  echo " first_tour_heuristic(8, List((0,0))) found and ok?" | tee -a $out
+  echo " first_tour_heuristic(50, List((0,0))) found and ok?" | tee -a $out
+  
+  if (scala_assert "knight3.scala.bak" "../../../marking/knight3c_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 7, Part 2" | tee -a $out