I'm using hspec
to do some basic testing.
I have a argsParser
function which given some arguments, returns or rather prints their validity.
argsParser :: [String] -> IO ()
argsParser args | null args = print "no args provided"
| not $ null args && length args < 2 = print "no file name provided"
| length args > 2 == print "too many arguments"
| otherwise = goAhead args
The problem is I'm not sure how I'd compare IO ()
with another IO ()
.
I thought maybe liftIO
could help but
x <- liftIO $ print "something"
y <- liftIO $ print "anything"
I get
x == y = True
which I suspect is because both are actions
.