Haskell

How to run student code and basic tests in Haskell

Vinay avatar
Written by Vinay
Updated over a week ago

Environment: 

  • Language: Java

  • Build Type: Custom - Ubuntu

  • Packages: apt-get install -y ghci

  • Run Script: None

  • Helper Files: None (optional)

Tests:

codePost unit test examples

  • Writing a bash unit test:

result=$(ghci MyTest.hs)

if [ $result == "expected result" ];
then
   TestOutput true "Passed!"
else
   TestOutput false "Failed. Received: $result"
fi
  • Writing an I/O test:

Did this answer your question?