equal
  deleted
  inserted
  replaced
  
    
    
     4   | 
     4   | 
     5 out=${1:-output} | 
     5 out=${1:-output} | 
     6   | 
     6   | 
     7 echo -e "" > $out  | 
     7 echo -e "" > $out  | 
     8   | 
     8   | 
     9 echo -e "Below is the feedback for your submission of CW 9, Part 2." >> $out  | 
     9 echo -e "Below is the feedback for your submission of CW 9, Preliminary Part." >> $out  | 
    10 echo -e "" >> $out  | 
    10 echo -e "" >> $out  | 
    11   | 
    11   | 
    12   | 
    12   | 
    13 # compilation tests  | 
    13 # compilation tests  | 
    14   | 
    14   | 
    17 }  | 
    17 }  | 
    18   | 
    18   | 
    19 # functional tests  | 
    19 # functional tests  | 
    20   | 
    20   | 
    21 function scala_assert { | 
    21 function scala_assert { | 
    22   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)   | 
    22   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)   | 
    23 }  | 
    23 }  | 
    24   | 
    24   | 
    25 # purity test  | 
    25 # purity test  | 
    26   | 
    26   | 
    27 function scala_vars { | 
    27 function scala_vars { | 
    33 #  | 
    33 #  | 
    34 echo -e "postfix.scala does not contain vars, returns etc?" >> $out  | 
    34 echo -e "postfix.scala does not contain vars, returns etc?" >> $out  | 
    35   | 
    35   | 
    36 if (scala_vars postfix.scala)  | 
    36 if (scala_vars postfix.scala)  | 
    37 then  | 
    37 then  | 
    38   echo -e "   --> fail (make triple-sure your program conforms to the required format)" >> $out   | 
    38   echo -e "   --> FAIL (make triple-sure your program conforms to the required format)" >> $out   | 
    39   tsts0=$(( 0 ))  | 
    39   tsts0=$(( 0 ))  | 
    40 else  | 
    40 else  | 
    41   echo -e "  --> success" >> $out  | 
    41   echo -e "  --> success" >> $out  | 
    42   tsts0=$(( 0 ))   | 
    42   tsts0=$(( 0 ))   | 
    43 fi  | 
    43 fi  | 
    95   else  | 
    95   else  | 
    96     echo -e "  --> \n ONE TEST FAILED\n" >> $out  | 
    96     echo -e "  --> \n ONE TEST FAILED\n" >> $out  | 
    97   fi  | 
    97   fi  | 
    98 fi  | 
    98 fi  | 
    99   | 
    99   | 
   100   | 
   100 echo -e "" >> $out  | 
   101   | 
   101   | 
   102 ### postfix2 tests  | 
   102 ### postfix2 tests  | 
   103   | 
   103   | 
   104 # var, return, ListBuffer test  | 
   104 # var, return, ListBuffer test  | 
   105 #  | 
   105 #  | 
   106 echo -e "\n\npostfix2.scala does not contain vars, returns etc?" >> $out  | 
   106 echo -e "\n\npostfix2.scala does not contain vars, returns etc?" >> $out  | 
   107   | 
   107   | 
   108 if (scala_vars postfix2.scala)  | 
   108 if (scala_vars postfix2.scala)  | 
   109 then  | 
   109 then  | 
   110   echo -e "   --> fail (make triple-sure your program conforms to the required format)" >> $out   | 
   110   echo -e "   --> FAIL (make triple-sure your program conforms to the required format)" >> $out   | 
   111   tsts0=$(( 0 ))  | 
   111   tsts0=$(( 0 ))  | 
   112 else  | 
   112 else  | 
   113   echo -e "  --> success" >> $out  | 
   113   echo -e "  --> success" >> $out  | 
   114   tsts0=$(( 0 ))   | 
   114   tsts0=$(( 0 ))   | 
   115 fi  | 
   115 fi  |