Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogacel committed Nov 9, 2022
1 parent f1fd6f4 commit 2423750
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ internal open class FileBuilder(val namer: Namer = Namer.Standard, val supportMa
} else {
to
}
} else
} else {
null
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions protoc-gen-pbandk/lib/src/jvmTest/kotlin/CodeGeneratorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CodeGeneratorTest {
result.classLoader.loadClass("newname.pkg.Message1").kotlin
result.classLoader.loadClass("newname.pkg.Message2").kotlin

assertTrue(kotlin.runCatching { result.classLoader.loadClass("foobar.Message1").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("foobar.Message1").kotlin }
}


Expand All @@ -98,7 +98,7 @@ class CodeGeneratorTest {
result.classLoader.loadClass("newname.pkg.foobar.Message1").kotlin
result.classLoader.loadClass("newname.pkg.foobar.Message2").kotlin

assertTrue(kotlin.runCatching { result.classLoader.loadClass("foobar.Message1").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("foobar.Message1").kotlin }
}

@Test
Expand All @@ -112,7 +112,7 @@ class CodeGeneratorTest {
result.classLoader.loadClass("newname.pkg.Message1").kotlin
result.classLoader.loadClass("newname.pkg.Message2").kotlin

assertTrue(kotlin.runCatching { result.classLoader.loadClass("foobar.Message1").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("foobar.Message1").kotlin }
}

@Test
Expand All @@ -127,7 +127,7 @@ class CodeGeneratorTest {
result.classLoader.loadClass("foobar.Message2").kotlin


assertTrue(kotlin.runCatching { result.classLoader.loadClass("newname.pkg.Message1").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("newname.pkg.Message1").kotlin }
}

@Test
Expand All @@ -140,7 +140,7 @@ class CodeGeneratorTest {
// New package name should replace the prefix.
result.classLoader.loadClass("newname.testpb.Proto3PresenceMessage").kotlin

assertTrue(kotlin.runCatching { result.classLoader.loadClass("pbandk.testpb.Proto3PresenceMessage").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("pbandk.testpb.Proto3PresenceMessage").kotlin }
}

@Test
Expand All @@ -154,7 +154,7 @@ class CodeGeneratorTest {
result.classLoader.loadClass("newname.javapackage.Foo").kotlin
result.classLoader.loadClass("newname.javapackage.Goo").kotlin

assertTrue(kotlin.runCatching { result.classLoader.loadClass("pbandk.javapackage.Foo").kotlin }.isFailure)
assertFails { result.classLoader.loadClass("pbandk.javapackage.Foo").kotlin }
}

private fun compileProto(inputProto: String, parameter: String? = null): KotlinCompilation.Result {
Expand Down

0 comments on commit 2423750

Please sign in to comment.