36 |
36 |
37 # var, return, ListBuffer test |
37 # var, return, ListBuffer test |
38 # |
38 # |
39 echo "re2.scala does not contain vars, returns etc?" | tee -a $out |
39 echo "re2.scala does not contain vars, returns etc?" | tee -a $out |
40 |
40 |
41 if (scala_vars re.scala) |
41 if (scala_vars re2.scala) |
42 then |
42 then |
43 echo " --> fail" | tee -a $out |
43 echo " --> fail" | tee -a $out |
44 tsts0=$(( 1 )) |
44 tsts0=$(( 1 )) |
45 else |
45 else |
46 echo " --> yes" | tee -a $out |
46 echo " --> yes" | tee -a $out |
63 fi |
63 fi |
64 else |
64 else |
65 tsts1=$(( 1 )) |
65 tsts1=$(( 1 )) |
66 fi |
66 fi |
67 |
67 |
68 #if [ $tsts1 -eq 0 ] |
68 if [ $tsts1 -eq 0 ] |
69 #then |
69 then |
70 # echo " nullable(ZERO) == false" | tee -a $out |
70 echo " iterT(200000, (x: Int) => x + 1, 0) == 200000" | tee -a $out |
71 # echo " nullable(ONE) == true" | tee -a $out |
71 echo " iterT(100, (x: BigInt) => x * 2, BigInt(2)) == BigInt(\"2535301200456458802993406410752\")" | tee -a $out |
72 # |
72 echo " iterT(10, (x: String) => x ++ \"a\", \"a\") == \"aaaaaaaaaaa\"" | tee -a $out |
73 # if (scala_assert "re.scala.bak" "../../../marking/re1a_test.scala") |
73 |
74 # then |
74 if (scala_assert "re2.scala" "../../../marking/re2a_test.scala") |
75 # echo " --> success" | tee -a $out |
75 then |
76 # marks=$(( marks + 1 )) |
76 echo " --> success" | tee -a $out |
77 # else |
77 marks=$(( marks + 2 )) |
78 # echo " --> test failed" | tee -a $out |
78 else |
79 # fi |
79 echo " --> test failed" | tee -a $out |
80 #fi |
80 fi |
|
81 fi |
81 |
82 |
|
83 if [ $tsts1 -eq 0 ] |
|
84 then |
|
85 echo " size(iterT(20, (r: Rexp) => der('a', r), EVIL)) == 7340068" | tee -a $out |
|
86 echo " size(iterT(20, (r: Rexp) => simp(der('a', r)), EVIL)) == 8" | tee -a $out |
|
87 |
|
88 if (scala_assert "re2.scala" "../../../marking/re2b_test.scala") |
|
89 then |
|
90 echo " --> success" | tee -a $out |
|
91 marks=$(( marks + 1 )) |
|
92 else |
|
93 echo " --> test failed" | tee -a $out |
|
94 fi |
|
95 fi |
|
96 |
|
97 if [ $tsts1 -eq 0 ] |
|
98 then |
|
99 echo " fixpT((x:Int) => if (200000 < x) x else x + 1, 0) == 200001" | tee -a $out |
|
100 echo " fixpT((x:Long) => if (20 < x) x else x + 1, 0L) == 21L" | tee -a $out |
|
101 |
|
102 if (scala_assert "re2.scala" "../../../marking/re2c_test.scala") |
|
103 then |
|
104 echo " --> success" | tee -a $out |
|
105 marks=$(( marks + 1 )) |
|
106 else |
|
107 echo " --> test failed" | tee -a $out |
|
108 fi |
|
109 fi |
82 |
110 |
83 ## final marks |
111 ## final marks |
84 echo "Overall mark for CW 8, Part 2" | tee -a $out |
112 echo "Overall mark for CW 8, Part 2" | tee -a $out |
85 echo "$marks" | tee -a $out |
113 echo "$marks" | tee -a $out |