package com.infendro.encoding import kotlin.test.Test import kotlin.test.assertContentEquals class `Base8 Test` { val encoding: Encoding get() = Base8 val `Hello World!` = ubyteArrayOf( 0x48U, 0x65U, 0x6cU, 0x6cU, 0x6fU, 0x20U, 0x57U, 0x6fU, 0x72U, 0x6cU, 0x64U, 0x21U, ) @Test fun `encode empty ByteArray`() { val expected = ubyteArrayOf() val actual = encoding.encode(ubyteArrayOf()) assertContentEquals(expected, actual) } @Test fun `encode "Hello World!"`() { val expected = ubyteArrayOf( 0x32U, 0x32U, 0x30U, 0x36U, 0x32U, 0x35U, 0x35U, 0x34U, 0x33U, 0x33U, 0x30U, 0x36U, 0x37U, 0x34U, 0x34U, 0x30U, 0x32U, 0x35U, 0x36U, 0x36U, 0x37U, 0x35U, 0x36U, 0x32U, 0x33U, 0x33U, 0x30U, 0x36U, 0x32U, 0x30U, 0x34U, 0x31U, ) val actual = encoding.encode(`Hello World!`) assertContentEquals(expected, actual) } }