more Buffer encodings

This commit is contained in:
sergeych committed 2025-08-17 19:26:15 +03:00
1 parent 2ac92a1d09
commit eefecae7b4
6 files changed
+83 -14

No files matched your search

@@ -2630,6 +2630,26 @@ class ScriptTest {
)
}
@Test
fun testBufferEncodings() = runTest {
eval("""
import lyng.buffer
val b = Buffer("hello")
println(b.toDump())
assertEquals( "hello", b.decodeUtf8() )
println(b.base64)
println(b.hex)
assertEquals( b, Buffer.decodeBase64(b.base64) )
assertEquals( b, Buffer.decodeHex(b.hex) )
println(b.inspect())
""".trimIndent())
}
@Test
fun testBufferCompare() = runTest {
eval(