I want to test a generic stack with scalatest and scalacheck. So far I have this:
"Stack" should "pop the last value pushed" in {
check(doPushPop(element))
}
def doPushPop[T](element : T) : Boolean = {
val stack = new Stack[T]
stack.push(element)
stack.pop() == element
}
However this doesn't compile obviously. How do I specify the generic type as part of the test?