You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parserTest :: Int -> Int -> IO ()
parserTest testsExecuted totalTests = if testsExecuted == totalTests then putStrLn ("\x1b[32m" ++ show totalTests ++ " tests passed\x1b[0m")
else generateActualForm >>= \x -> let resultingForm = parse (show x) in if length resultingForm == 1 && equiv x (head resultingForm) then
do putStrLn ("pass on: " ++ show x)
parserTest (testsExecuted+1) totalTests
else error ("failed test on: " ++ show x)
equiv is not sufficient. Required is: That the forms have the same shape. So
parserTest :: Int -> Int -> IO ()
parserTest testsExecuted totalTests = if testsExecuted == totalTests then putStrLn ("\x1b[32m" ++ show totalTests ++ " tests passed\x1b[0m")
else generateActualForm >>= \x -> let resultingForm = parse (show x) in if length resultingForm == 1 && x == (head resultingForm) then
do putStrLn ("pass on: " ++ show x)
parserTest (testsExecuted+1) totalTests
else error ("failed test on: " ++ show x)
The text was updated successfully, but these errors were encountered:
Exercise 1
Nice solution with
uncurry
.Exercise 2
equiv
is not sufficient. Required is: That the forms have the same shape. SoThe text was updated successfully, but these errors were encountered: