I am trying to do TDD in haskell using HSpec. So while writing special case scenario for division operator for example:
3 / 0 => Infinity
0 / 0 => Nan
How to test the above cases using Hspec ?
Use the functions isInfinite and isNaN:
Prelude> isInfinite (3 / 0.0)
True
Prelude> isNaN (0.0/0.0)
True