1

I have a n-ary tree defined as follows:

data Tree = Leaf1 | Leaf2 | Tree ([Tree]) 

and I have a function

eval :: Tree -> int

which returns the winner (Leaf1 indicates that player one won, Leaf2 indicates that player two won)

I've been trying to write a test for eval using QuickCheck but I can't seem to understand how it works for recursive data types and how to write tests for this function

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
Ak-Mo
  • 389
  • 1
  • 4
  • 18

0 Answers0