Sha256: 4b10dd0181274adf6e18aa6c1889c0aa1de9c9a667b6709ae9bb677bff822e32
Contents?: true
Size: 1.02 KB
Versions: 72
Compression:
Stored size: 1.02 KB
Contents
import java.io.File import testgen.TestSuiteBuilder._ import testgen._ object CollatzConjectureTestGenerator { def main(args: Array[String]): Unit = { val file = new File("src/main/resources/collatz-conjecture.json") def toString(expected: CanonicalDataParser.Expected): String = { expected match { case Left(_) => "None" case Right(null) => "None" case Right(n) => s"Some($n)" } } def fromLabeledTestFromInput(argNames: String*): ToTestCaseData = withLabeledTest { sut => labeledTest => val args = sutArgsFromInput(labeledTest.result, argNames: _*) val property = labeledTest.property val sutCall = s"""$sut.$property($args)""" val expected = toString(labeledTest.expected) TestCaseData(labeledTest.description, sutCall, expected) } val code = TestSuiteBuilder.build(file, fromLabeledTestFromInput("number")) println(s"-------------") println(code) println(s"-------------") } }
Version data entries
72 entries across 72 versions & 1 rubygems