Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbryzek committed May 29, 2024
1 parent b77239c commit b09705f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class KotlinGeneratorTest

private val serviceDefs = Seq(builtInTypesService,
// dateTimeService,
// generatorApiServiceWithUnionAndDescriminator,
// generatorApiServiceWithUnionAndDiscriminator,
apidocApiService,
collectionJsonDefaultsService,
referenceApiService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ object KotlinTestHelper extends Matchers {

def assertKotlinCodeCompiles(kotlinSourceDirectory: java.io.File): Unit = {
assert(kotlinSourceDirectory.exists())
assert(kotlinSourceDirectory.canRead())
assert(kotlinSourceDirectory.isDirectory())
assert(kotlinSourceDirectory.canRead)
assert(kotlinSourceDirectory.isDirectory)
val result = new KotlinCompiler().compileSourceDir(kotlinSourceDirectory.toPath)
result.isSuccess shouldBe true
()
Expand Down
14 changes: 6 additions & 8 deletions scala-generator/src/test/scala/utils/ScalaFormatterSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ import org.scalatest.matchers.should.Matchers

class ScalaFormatterSpec extends AnyFunSpec with Matchers {

it("ScalaFormatter should format valid scala code") {
val contents = "case class Foo(bar: String)"
val result = ScalaFormatter.format(contents)
private[this] def format(code: String) = {
ScalaFormatter.format(code)
}

result should be(Symbol("right"))
it("ScalaFormatter should format valid scala code") {
format("case class Foo(bar: String)") should be(Symbol("right"))
}

it("ScalaFormatter should fail to format invalid scala code") {
val contents = "Foo Bar"
val result = ScalaFormatter.format(contents)

result should be(Symbol("left"))
format("Foo Bar {") should be(Symbol("left"))
}

}

0 comments on commit b09705f

Please sign in to comment.