improve test coverage

This commit is contained in:
2026-01-17 13:46:57 +01:00
parent 83fd77c8ee
commit a553aa6723
12 changed files with 259 additions and 184 deletions

View File

@@ -1,35 +0,0 @@
package com.infendro.encoding
import com.infendro.encoding.stream.Base16
import com.infendro.encoding.stream.StreamEncoding
import kotlin.test.Test
import kotlin.test.assertContentEquals
class `Base16 Test` {
val encoding: StreamEncoding
get() = Base16
val `Hello World!` = byteArrayOf(
0x48, 0x65, 0x6c, 0x6c,
0x6f, 0x20, 0x57, 0x6f,
0x72, 0x6c, 0x64, 0x21,
)
@Test
fun `encode empty ByteArray`() {
val expected = byteArrayOf()
val actual = encoding.encode(byteArrayOf())
assertContentEquals(expected, actual)
}
@Test
fun `encode "Hello World!"`() {
val expected = byteArrayOf(
0x34, 0x38, 0x36, 0x35, 0x36, 0x63, 0x36, 0x63,
0x36, 0x66, 0x32, 0x30, 0x35, 0x37, 0x36, 0x66,
0x37, 0x32, 0x36, 0x63, 0x36, 0x34, 0x32, 0x31,
)
val actual = encoding.encode(`Hello World!`)
assertContentEquals(expected, actual)
}
}