kumalka
kumalka

Reputation: 33

Tasty HUnit test against Either

I am fairly new to Haskell, and I was wondering if there is a way to test a pattern match, as in erlang. An example is a function that returns an Either a b, Can I match against Left b, whilst ignoring b itself?

In my case, I have Either String Error. I simply want to test if an error occurs, but it's a bit tedious to write out the entire error text for each test case, so I simply want to assert that it in fact does return a Right error.

Upvotes: 0

Views: 444

Answers (1)

Related Questions