I am trying to write some test cases using HUnit in Haskell for a function using the Gloss Graphics library.
The function:
makePicture :: Color -> Picture
makePicture c = Color c $ Circle 80
If I display a call to this function with argument "black" in a console you see something like:
Color (RGBA 0.0 0.0 0.0 1.0) (Circle 80.0)
Which has the type of a Picture. My question is how do I properly write a test case for something like this?
The problem occurs if I try to write a test like:
test = TestCase $ assertEqual "makePicture" (Color (RGBA 0.0 0.0 0.0 1.0) (Circle 80.0)) (makePicture black)
It can't compile, because it says the following:
error: Data constructor not in scope: RGBA
Anyone have any ideas how I can write a test case for my function?