Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prettier Tasty
module TestParser where import Test.Tasty (TestTree, defaultMain, testGroup, TestName) import Test.Tasty.HUnit (testCase, (@?=)) import Parser (Token(..), lookAhead) prettyTestCaseShow :: Show a => TestName -> a -> TestTree prettyTestCaseShow prettyOut construct = testCase prettyOut $ show construct @?= prettyOut prettyTestCase :: (Eq a, Show a) => (TestName -> a) -> TestName -> a -> TestTree prettyTestCase f input result = let prettyIn = if null input then "Empty input" else input in testCase prettyIn $ f input @?= result testParser :: TestTree testParser = testGroup "all" testTokenizer testTokenizer = [ testCase "" $ (lookAhead []) @?= TokEnd, prettyTestCase lookAhead [] TokEnd, prettyTestCase lookAhead "()" TokLParen ]
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
equiv_strings
Anonymous recursion. Why doesnt compile?
Quicksort in Haskell
znajdywacz trojkatow prostokatnych
Pascal's triangle in 10 lines
perfect numbers
Test
project euler 10, haskell
project euler 5, haskell
Pi
Please log in to post a comment.