Run Code
|
API
|
Code Wall
|
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
Forkitup
(-‿‿-)
Pascal's triangle in 10 lines
equiv_strings
Bruteforce IEEE Floating Point Numbers
Kleintjes
ad-hoc braille dot rendering
preparednessQuotient
=)
Haskell Tree example