# HG changeset patch # User Christian Urban # Date 1572700785 0 # Node ID 4a9d1153ccc5ffb4b17c4646908ab7955e6f3960 # Parent b4c597be75147e09b513e99e56e3354a0e1e9341 updated diff -r b4c597be7514 -r 4a9d1153ccc5 testing1/drumb_test.sh --- a/testing1/drumb_test.sh Sat Nov 02 12:06:07 2019 +0000 +++ b/testing1/drumb_test.sh Sat Nov 02 13:19:45 2019 +0000 @@ -3,10 +3,10 @@ out=${1:-output} -echo "" > $out +echo -e "" > $out -echo "Below is the feedback for your submission for drumb.scala" >> $out -echo "" >> $out +echo -e "Below is the feedback for your submission for drumb.scala" >> $out +echo -e "" >> $out # compilation tests @@ -29,14 +29,14 @@ # var, .par return, ListBuffer test # -echo "drumb.scala does not contain vars, returns etc?" >> $out +echo -e "drumb.scala does not contain vars, returns etc?" >> $out if (scala_vars drumb.scala) then - echo " --> FAIL (make triple-sure your program conforms to the required format)" >> $out + echo -e " --> FAIL (make triple-sure your program conforms to the required format)" >> $out tsts0=$(( 0 )) else - echo " --> success" >> $out + echo -e " --> success" >> $out tsts0=$(( 0 )) fi @@ -44,14 +44,14 @@ # compilation test if [ $tsts0 -eq 0 ] then - echo "drumb.scala runs?" >> $out + echo -e "drumb.scala runs?" >> $out if (scala_compile drumb.scala) then - echo " --> success" >> $out + echo -e " --> success" >> $out tsts=$(( 0 )) else - echo " --> SCALA DID NOT RUN drumb.scala" >> $out + echo -e " --> SCALA DID NOT RUN drumb.scala" >> $out tsts=$(( 1 )) fi else @@ -62,14 +62,14 @@ if [ $tsts -eq 0 ] then - echo " get_january_data(\"GOOG\", 1980) == List()" >> $out - echo " get_january_data(\"GOOG\", 2010).head == \"2010-01-04,312.204773\"" >> $out + echo -e " get_january_data(\"GOOG\", 1980) == List()" >> $out + echo -e " get_january_data(\"GOOG\", 2010).head == \"2010-01-04,312.204773\"" >> $out if (scala_assert "drumb.scala" "drumb_test1.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -77,14 +77,14 @@ if [ $tsts -eq 0 ] then - echo " get_first_price(\"GOOG\", 1980) == None" >> $out - echo " get_first_price(\"GOOG\", 2010) == Some(312.204773)" >> $out + echo -e " get_first_price(\"GOOG\", 1980) == None" >> $out + echo -e " get_first_price(\"GOOG\", 2010) == Some(312.204773)" >> $out if (scala_assert "drumb.scala" "drumb_test2.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -92,16 +92,16 @@ if [ $tsts -eq 0 ] then - echo " get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012) ==" >> $out - echo " List(List(Some(311.349976), Some(20.544939))," >> $out - echo " List(Some(300.222351), Some(31.638695))," >> $out - echo " List(Some(330.555054), Some(39.478039)))" >> $out + echo -e " get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012) ==" >> $out + echo -e " List(List(Some(311.349976), Some(20.544939))," >> $out + echo -e " List(Some(300.222351), Some(31.638695))," >> $out + echo -e " List(Some(330.555054), Some(39.478039)))" >> $out if (scala_assert "drumb.scala" "drumb_test3.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -109,16 +109,16 @@ if [ $tsts -eq 0 ] then - echo " get_delta(None, None) == None" >> $out - echo " get_delta(Some(50.0), None) == None" >> $out - echo " get_delta(None, Some(100.0)) == None" >> $out - echo " get_delta(Some(50.0), Some(100.0)) == Some(1.0)" >> $out + echo -e " get_delta(None, None) == None" >> $out + echo -e " get_delta(Some(50.0), None) == None" >> $out + echo -e " get_delta(None, Some(100.0)) == None" >> $out + echo -e " get_delta(Some(50.0), Some(100.0)) == Some(1.0)" >> $out if (scala_assert "drumb.scala" "drumb_test4.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -137,9 +137,9 @@ if (scala_assert "drumb.scala" "drumb_test5.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -154,9 +154,9 @@ if (scala_assert "drumb.scala" "drumb_test6.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi @@ -179,9 +179,9 @@ if (scala_assert "drumb.scala" "drumb_test7.scala") then - echo " --> success" >> $out + echo -e " --> success" >> $out else - echo " --> ONE OF THE TESTS FAILED\n" >> $out + echo -e " --> ONE OF THE TESTS FAILED\n" >> $out fi fi