63 |
63 |
64 ### postfix tests |
64 ### postfix tests |
65 |
65 |
66 if [ $tsts1 -eq 0 ] |
66 if [ $tsts1 -eq 0 ] |
67 then |
67 then |
68 echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"*\", \"+\")" >> $out |
68 echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"\*\", \"+\")" >> $out |
69 echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" >> $out |
69 echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" >> $out |
70 echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" >> $out |
70 echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" >> $out |
71 echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"*\", \"2\", \"/\")" >> $out |
71 echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"\*\", \"2\", \"/\")" >> $out |
72 |
72 |
73 if (scala_assert "postfix.scala" "postfix_test7.scala") |
73 if (scala_assert "postfix.scala" "postfix_test7.scala") |
74 then |
74 then |
75 echo -e " --> success" >> $out |
75 echo -e " --> success" >> $out |
76 else |
76 else |
134 fi |
134 fi |
135 |
135 |
136 |
136 |
137 if [ $tsts1 -eq 0 ] |
137 if [ $tsts1 -eq 0 ] |
138 then |
138 then |
139 echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"*\", \"+\")" >> $out |
139 echo -e " syard(split(\"3 + 4 * ( 2 - 1 )\")) == List(\"3\", \"4\", \"2\", \"1\", \"-\", \"\*\", \"+\")" >> $out |
140 echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" >> $out |
140 echo -e " syard(split(\"( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )\")) == List(\"3\", \"4\", \"5\", \"+\", \"+\")" >> $out |
141 echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" >> $out |
141 echo -e " syard(split(\"5 + 7 / 2\")) == List(\"5\", \"7\", \"2\", \"/\", \"+\")" >> $out |
142 echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"*\", \"2\", \"/\")" >> $out |
142 echo -e " syard(split(\"5 * 7 / 2\")) == List(\"5\", \"7\", \"\*\", \"2\", \"/\")" >> $out |
143 echo -e " syard(split(\"3 + 4 * 8 / ( 5 - 1 ) ^ 2 ^ 3\")) == " >> $out |
143 echo -e " syard(split(\"3 + 4 * 8 / ( 5 - 1 ) ^ 2 ^ 3\")) == " >> $out |
144 echo -e " List(\"3\", \"4\", \"8\", \"*\", \"5\", \"1\", \"-\", \"2\", \"3\", \"^\", \"^\", \"/\", \"+\")" >> $out |
144 echo -e " List(\"3\", \"4\", \"8\", \"\*\", \"5\", \"1\", \"-\", \"2\", \"3\", \"^\", \"^\", \"/\", \"+\")" >> $out |
145 echo -e " " >> $out |
145 echo -e " " >> $out |
146 echo -e " compute(syard(split(\"3 + 4 * ( 2 - 1 )\"))) == 7" >> $out |
146 echo -e " compute(syard(split(\"3 + 4 * ( 2 - 1 )\"))) == 7" >> $out |
147 echo -e " compute(syard(split(\"10 + 12 * 33\"))) == 406" >> $out |
147 echo -e " compute(syard(split(\"10 + 12 * 33\"))) == 406" >> $out |
148 echo -e " compute(syard(split(\"( 5 + 7 ) * 2\"))) == 24" >> $out |
148 echo -e " compute(syard(split(\"( 5 + 7 ) * 2\"))) == 24" >> $out |
149 echo -e " compute(syard(split(\"5 + 7 / 2\"))) == 8" >> $out |
149 echo -e " compute(syard(split(\"5 + 7 / 2\"))) == 8" >> $out |