improve ci
All checks were successful
/ test (push) Successful in 3m25s
/ publish (push) Has been skipped

This commit is contained in:
2026-01-13 15:50:29 +01:00
parent 1195ad5acc
commit 9391009403
6 changed files with 146 additions and 90 deletions

View File

@@ -7,7 +7,7 @@ import kotlin.test.assertEquals
class `Conversion Test` {
@Test
fun `ByteArray - toInt()`() {
fun `ByteArray toInt`() {
val expected = 0x12345678
val actual = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78).toInt(),
@@ -18,7 +18,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toInt()`() {
fun `UByteArray toInt`() {
val expected = 0x12345678
val actual = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U).toInt(),
@@ -29,7 +29,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toUInt()`() {
fun `ByteArray toUInt`() {
val expected = 0x12345678U
val actual = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78).toUInt(),
@@ -40,7 +40,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toUInt()`() {
fun `UByteArray toUInt`() {
val expected = 0x12345678U
val actual = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U).toUInt(),
@@ -51,7 +51,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toIntArray()`() {
fun `ByteArray toIntArray`() {
val expected = intArrayOf(0x12345678, 0x12345678)
val actual = arrayOf(
byteArrayOf(
@@ -68,7 +68,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toIntArray()`() {
fun `UByteArray toIntArray`() {
val expected = intArrayOf(0x12345678, 0x12345678)
val actual = arrayOf(
ubyteArrayOf(
@@ -85,7 +85,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toUIntArray()`() {
fun `ByteArray toUIntArray`() {
val expected = uintArrayOf(0x12345678U, 0x12345678U)
val actual = arrayOf(
byteArrayOf(
@@ -102,7 +102,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toUIntArray()`() {
fun `UByteArray toUIntArray`() {
val expected = uintArrayOf(0x12345678U, 0x12345678U)
val actual = arrayOf(
ubyteArrayOf(
@@ -119,7 +119,7 @@ class `Conversion Test` {
}
@Test
fun `Int - toByteArray()`() {
fun `Int toByteArray`() {
val expected = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78),
byteArrayOf(0x78, 0x56, 0x34, 0x12),
@@ -134,7 +134,7 @@ class `Conversion Test` {
}
@Test
fun `UInt - toByteArray()`() {
fun `UInt toByteArray`() {
val expected = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78),
byteArrayOf(0x78, 0x56, 0x34, 0x12),
@@ -149,7 +149,7 @@ class `Conversion Test` {
}
@Test
fun `Int - toUByteArray()`() {
fun `Int toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U),
ubyteArrayOf(0x78U, 0x56U, 0x34U, 0x12U),
@@ -164,7 +164,7 @@ class `Conversion Test` {
}
@Test
fun `UInt - toUByteArray()`() {
fun `UInt toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U),
ubyteArrayOf(0x78U, 0x56U, 0x34U, 0x12U),
@@ -179,7 +179,7 @@ class `Conversion Test` {
}
@Test
fun `IntArray - toByteArray()`() {
fun `IntArray toByteArray`() {
val expected = arrayOf(
byteArrayOf(
0x12, 0x34, 0x56, 0x78,
@@ -206,7 +206,7 @@ class `Conversion Test` {
}
@Test
fun `UIntArray - toByteArray()`() {
fun `UIntArray toByteArray`() {
val expected = arrayOf(
byteArrayOf(
0x12, 0x34, 0x56, 0x78,
@@ -233,7 +233,7 @@ class `Conversion Test` {
}
@Test
fun `IntArray - toUByteArray()`() {
fun `IntArray toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(
0x12U, 0x34U, 0x56U, 0x78U,
@@ -260,7 +260,7 @@ class `Conversion Test` {
}
@Test
fun `UIntArray - toUByteArray()`() {
fun `UIntArray toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(
0x12U, 0x34U, 0x56U, 0x78U,
@@ -287,7 +287,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toLong()`() {
fun `ByteArray toLong`() {
val expected = 0x1234567812345678L
val actual = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78).toLong(),
@@ -298,7 +298,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toULong()`() {
fun `UByteArray toULong`() {
val expected = 0x1234567812345678UL
val actual = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U).toULong(),
@@ -309,7 +309,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toLong()`() {
fun `UByteArray toLong`() {
val expected = 0x1234567812345678L
val actual = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U).toLong(),
@@ -320,7 +320,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toULong()`() {
fun `ByteArray toULong`() {
val expected = 0x1234567812345678UL
val actual = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78).toULong(),
@@ -331,7 +331,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toLongArray()`() {
fun `ByteArray toLongArray`() {
val expected = longArrayOf(0x1234567812345678L, 0x1234567812345678L)
val actual = arrayOf(
byteArrayOf(
@@ -348,7 +348,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toLongArray()`() {
fun `UByteArray toLongArray`() {
val expected = longArrayOf(0x1234567812345678L, 0x1234567812345678L)
val actual = arrayOf(
ubyteArrayOf(
@@ -365,7 +365,7 @@ class `Conversion Test` {
}
@Test
fun `ByteArray - toULongArray()`() {
fun `ByteArray toULongArray`() {
val expected = ulongArrayOf(0x1234567812345678UL, 0x1234567812345678UL)
val actual = arrayOf(
byteArrayOf(
@@ -382,7 +382,7 @@ class `Conversion Test` {
}
@Test
fun `UByteArray - toULongArray()`() {
fun `UByteArray toULongArray`() {
val expected = ulongArrayOf(0x1234567812345678UL, 0x1234567812345678UL)
val actual = arrayOf(
ubyteArrayOf(
@@ -399,7 +399,7 @@ class `Conversion Test` {
}
@Test
fun `Long - toByteArray()`() {
fun `Long toByteArray`() {
val expected = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78),
byteArrayOf(0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12),
@@ -414,7 +414,7 @@ class `Conversion Test` {
}
@Test
fun `ULong - toByteArray()`() {
fun `ULong toByteArray`() {
val expected = arrayOf(
byteArrayOf(0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78),
byteArrayOf(0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12),
@@ -429,7 +429,7 @@ class `Conversion Test` {
}
@Test
fun `Long - toUByteArray()`() {
fun `Long toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U),
ubyteArrayOf(0x78U, 0x56U, 0x34U, 0x12U, 0x78U, 0x56U, 0x34U, 0x12U),
@@ -444,7 +444,7 @@ class `Conversion Test` {
}
@Test
fun `ULong - toUByteArray()`() {
fun `ULong toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U),
ubyteArrayOf(0x78U, 0x56U, 0x34U, 0x12U, 0x78U, 0x56U, 0x34U, 0x12U),
@@ -459,7 +459,7 @@ class `Conversion Test` {
}
@Test
fun `LongArray - toByteArray()`() {
fun `LongArray toByteArray`() {
val expected = arrayOf(
byteArrayOf(
0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
@@ -486,7 +486,7 @@ class `Conversion Test` {
}
@Test
fun `ULongArray - toByteArray()`() {
fun `ULongArray toByteArray`() {
val expected = arrayOf(
byteArrayOf(
0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
@@ -513,7 +513,7 @@ class `Conversion Test` {
}
@Test
fun `LongArray - toUByteArray()`() {
fun `LongArray toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(
0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U,
@@ -540,7 +540,7 @@ class `Conversion Test` {
}
@Test
fun `ULongArray - toUByteArray()`() {
fun `ULongArray toUByteArray`() {
val expected = arrayOf(
ubyteArrayOf(
0x12U, 0x34U, 0x56U, 0x78U, 0x12U, 0x34U, 0x56U, 0x78U,

View File

@@ -6,7 +6,7 @@ import kotlin.test.assertEquals
class `Modification Test` {
@Test
fun `ByteArray - padStart()`() {
fun `ByteArray padStart`() {
val expected = byteArrayOf(0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02)
val actual = byteArrayOf(0x02, 0x02).padStart(8, 0x01)
assertEquals(8, actual.size)
@@ -14,7 +14,7 @@ class `Modification Test` {
}
@Test
fun `ByteArray - padStart() - unchanged`() {
fun `ByteArray padStart - unchanged`() {
val expected = byteArrayOf(0x02, 0x02)
val actual = byteArrayOf(0x02, 0x02).padStart(2, 0x01)
assertEquals(2, actual.size)
@@ -22,7 +22,7 @@ class `Modification Test` {
}
@Test
fun `UByteArray - padStart()`() {
fun `UByteArray padStart`() {
val expected = ubyteArrayOf(0x01U, 0x01U, 0x01U, 0x01U, 0x01U, 0x01U, 0x02U, 0x02U)
val actual = ubyteArrayOf(0x02U, 0x02U).padStart(8, 0x01U)
assertEquals(8, actual.size)
@@ -30,7 +30,7 @@ class `Modification Test` {
}
@Test
fun `UByteArray - padStart() - unchanged`() {
fun `UByteArray padStart - unchanged`() {
val expected = ubyteArrayOf(0x02U, 0x02U)
val actual = ubyteArrayOf(0x02U, 0x02U).padStart(2, 0x01U)
assertEquals(2, actual.size)
@@ -38,7 +38,7 @@ class `Modification Test` {
}
@Test
fun `ByteArray - padEnd()`() {
fun `ByteArray padEnd`() {
val expected = byteArrayOf(0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01)
val actual = byteArrayOf(0x02, 0x02).padEnd(8, 0x01)
assertEquals(8, actual.size)
@@ -46,7 +46,7 @@ class `Modification Test` {
}
@Test
fun `ByteArray - padEnd() - unchanged`() {
fun `ByteArray padEnd - unchanged`() {
val expected = byteArrayOf(0x02, 0x02)
val actual = byteArrayOf(0x02, 0x02).padEnd(2, 0x01)
assertEquals(2, actual.size)
@@ -54,7 +54,7 @@ class `Modification Test` {
}
@Test
fun `UByteArray - padEnd()`() {
fun `UByteArray padEnd`() {
val expected = ubyteArrayOf(0x02U, 0x02U, 0x01U, 0x01U, 0x01U, 0x01U, 0x01U, 0x01U)
val actual = ubyteArrayOf(0x02U, 0x02U).padEnd(8, 0x01U)
assertEquals(8, actual.size)
@@ -62,7 +62,7 @@ class `Modification Test` {
}
@Test
fun `UByteArray - padEnd() - unchanged`() {
fun `UByteArray padEnd - unchanged`() {
val expected = ubyteArrayOf(0x02U, 0x02U)
val actual = ubyteArrayOf(0x02U, 0x02U).padEnd(2, 0x01U)
assertEquals(2, actual.size)

View File

@@ -6,7 +6,7 @@ import kotlin.test.assertFails
class `Operators Test` {
@Test
fun `ByteArray - and() - size`() {
fun `ByteArray and - size`() {
assertFails {
byteArrayOf() and byteArrayOf(0x00)
}
@@ -16,14 +16,14 @@ class `Operators Test` {
}
@Test
fun `ByteArray - and()`() {
fun `ByteArray and`() {
val expected = byteArrayOf(0x18, 0x00)
val actual = byteArrayOf(0x5C, 0x70) and byteArrayOf(0x3A, 0x0F)
assertContentEquals(expected, actual)
}
@Test
fun `UByteArray - and() - size`() {
fun `UByteArray and - size`() {
assertFails {
ubyteArrayOf() and ubyteArrayOf(0x00U)
}
@@ -33,14 +33,14 @@ class `Operators Test` {
}
@Test
fun `UByteArray - and()`() {
fun `UByteArray and`() {
val expected = ubyteArrayOf(0x18U, 0x00U)
val actual = ubyteArrayOf(0x5CU, 0x70U) and ubyteArrayOf(0x3AU, 0x0FU)
assertContentEquals(expected, actual)
}
@Test
fun `ByteArray - or() - size`() {
fun `ByteArray or - size`() {
assertFails {
byteArrayOf() or byteArrayOf(0x00)
}
@@ -50,14 +50,14 @@ class `Operators Test` {
}
@Test
fun `ByteArray - or()`() {
fun `ByteArray or`() {
val expected = byteArrayOf(0x7E, 0x7F)
val actual = byteArrayOf(0x5C, 0x70) or byteArrayOf(0x3A, 0x0F)
assertContentEquals(expected, actual)
}
@Test
fun `UByteArray - or() - size`() {
fun `UByteArray or - size`() {
assertFails {
ubyteArrayOf() or ubyteArrayOf(0x00U)
}
@@ -67,14 +67,14 @@ class `Operators Test` {
}
@Test
fun `UByteArray - or()`() {
fun `UByteArray or`() {
val expected = ubyteArrayOf(0x7EU, 0x7FU)
val actual = ubyteArrayOf(0x5CU, 0x70U) or ubyteArrayOf(0x3AU, 0x0FU)
assertContentEquals(expected, actual)
}
@Test
fun `ByteArray - xor() - size`() {
fun `ByteArray xor - size`() {
assertFails {
byteArrayOf() xor byteArrayOf(0x00)
}
@@ -84,14 +84,14 @@ class `Operators Test` {
}
@Test
fun `ByteArray - xor()`() {
fun `ByteArray xor`() {
val expected = byteArrayOf(0x66, 0x7F)
val actual = byteArrayOf(0x5C, 0x70) xor byteArrayOf(0x3A, 0x0F)
assertContentEquals(expected, actual)
}
@Test
fun `UByteArray - xor() - size`() {
fun `UByteArray xor - size`() {
assertFails {
ubyteArrayOf() xor ubyteArrayOf(0x00U)
}
@@ -101,7 +101,7 @@ class `Operators Test` {
}
@Test
fun `UByteArray - xor()`() {
fun `UByteArray xor`() {
val expected = ubyteArrayOf(0x66U, 0x7FU)
val actual = ubyteArrayOf(0x5CU, 0x70U) xor ubyteArrayOf(0x3AU, 0x0FU)
assertContentEquals(expected, actual)

View File

@@ -6,14 +6,14 @@ import kotlin.test.assertEquals
class `String Test` {
@Test
fun `encodeToUByteArray()`() {
fun `UByteArray encodeToUByteArray`() {
val expected = ubyteArrayOf(0x50U, 0x41U, 0x53U, 0x53U, 0x57U, 0x4FU, 0x52U, 0x44U)
val actual = "PASSWORD".encodeToUByteArray()
assertContentEquals(expected, actual)
}
@Test
fun `decodeToString()`() {
fun `UByteArray decodeToString`() {
val expected = "PASSWORD"
val actual = ubyteArrayOf(0x50U, 0x41U, 0x53U, 0x53U, 0x57U, 0x4FU, 0x52U, 0x44U).decodeToString()
assertEquals(expected, actual)