main_testing3/re_test.sh
changeset 426 b51467741af2
parent 424 daf561a83ba6
child 433 6af86ba1208f
equal deleted inserted replaced
425:957808dcb367 426:b51467741af2
    23 }
    23 }
    24 
    24 
    25 # purity test
    25 # purity test
    26 
    26 
    27 function scala_vars {
    27 function scala_vars {
    28    (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
    28     (sed 's/immutable/ok/g' c$out > cb$out;
       
    29      egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
    29 }
    30 }
    30 
    31 
    31 
    32 
    32 
    33 
    33 # compilation test
    34 # compilation test
    58 	echo -e "  --> passed" >> $out
    59 	echo -e "  --> passed" >> $out
    59 	tsts=$(( 0 )) 
    60 	tsts=$(( 0 )) 
    60     fi
    61     fi
    61 fi
    62 fi
    62 
    63 
       
    64 ### make sure datatypes are not tampered with
    63 
    65 
       
    66 if [ $tsts -eq 0 ]
       
    67 then
       
    68     echo -e "re.scala has case classes for ALTs and SEQs?" >> $out
       
    69 
       
    70     if (scala_assert "re.scala" "re_test0.scala")
       
    71     then
       
    72 	echo -e "  --> passed" >> $out
       
    73 	tsts=$(( 0 ))
       
    74     else	
       
    75 	echo -e "  --> FAIL (make sure the case clases are as given in the template)" >> $out 
       
    76 	tsts=$(( 1 ))
       
    77     fi
       
    78 fi
    64 
    79 
    65 ### re tests
    80 ### re tests
    66 
    81 
    67 if [ $tsts -eq 0 ]
    82 if [ $tsts -eq 0 ]
    68 then
    83 then