TheBizzle/PathFinding — Issue #19: Tester - Auto-Generation of TestFunctions
Author: TheBizzle
Created: 2012-01-18 06:47:28+00:00
State: open
Labels: Tester

Could use reflection on the test strings to auto-generate test functions. Here's how (generally and messily):

object Test{num} extends PathFindingTestFunction(testStr)

abstract class PathFindingTestFunction(testString: TestMapString{num}[F])(implicitly (testNum, shouldPass) by reflection) extends TestFunction[PathFinder[StepData]](testNum, shouldPass) {
val testStr = testString
def apply(...) : Boolean = {
analyze(pathFinder(testStr), isTalkative)
}
}