-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental support for Kotlin tests
- Loading branch information
Showing
2 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.esotericsoftware.kryo | ||
|
||
import com.esotericsoftware.kryo.io.Input | ||
import com.esotericsoftware.kryo.io.Output | ||
import org.junit.jupiter.api.Disabled | ||
import org.junit.jupiter.api.Test | ||
|
||
class LambdaTest { | ||
private class Example(private val p: (Long) -> String) { | ||
constructor() : this({ it.toString() }) | ||
} | ||
|
||
@Test | ||
@Disabled("Expected to fail") | ||
fun testLambda() { | ||
val kryo = Kryo().apply { | ||
isRegistrationRequired = false | ||
} | ||
|
||
val example = Example() | ||
|
||
val bytes = Output(1024).use { output -> | ||
kryo.writeClassAndObject(output, example) | ||
output.toBytes() | ||
} | ||
|
||
val deserialized = Input(bytes).use { input -> | ||
kryo.readClassAndObject(input) | ||
} | ||
|
||
println(deserialized) | ||
} | ||
} |