Sha256: a8b075998c978cddb4e315dc860876dafc39c8a6ed55478c5307e77bf8ba06fa
Contents?: true
Size: 1.06 KB
Versions: 74
Compression:
Stored size: 1.06 KB
Contents
import java.io.File import testgen.TestSuiteBuilder.{toString, _} import testgen._ object AllYourBaseTestGenerator { def main(args: Array[String]): Unit = { val file = new File("src/main/resources/all-your-base.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"""AllYourBase.$property($args)""" val expected = toString(labeledTest.expected) TestCaseData(labeledTest.description, sutCall, expected) } val code = TestSuiteBuilder.build(file, fromLabeledTestFromInput("inputBase", "digits", "outputBase")) println(s"-------------") println(code) println(s"-------------") } }
Version data entries
74 entries across 74 versions & 1 rubygems