unit tests now using hex utils

master
Robinson 2023-08-21 00:52:44 +02:00
parent 6e405b25f0
commit d48c321868
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
3 changed files with 4 additions and 1 deletions

View File

@ -104,6 +104,7 @@ dependencies {
compileOnly("org.tukaani:xz:1.9") // LZMA support, optional
testImplementation("com.dorkbox:HexUtilities:1.0") // watch-out for circular deps!
testImplementation("io.netty:netty-buffer:4.1.96.Final")
testImplementation("com.esotericsoftware:kryo:5.5.0")
testImplementation("org.lz4:lz4-java:1.8.0")

View File

@ -15,6 +15,7 @@
*/
package dorkbox.bytes
import dorkbox.hex.hexToByteArray
import org.junit.Assert.assertTrue
import org.junit.Test

View File

@ -15,6 +15,7 @@
*/
package dorkbox.bytes
import dorkbox.hex.toHexString
import org.junit.Assert.*
import org.junit.Test
import java.io.File
@ -61,7 +62,7 @@ class TestHashing {
// https://stackoverflow.com/questions/54247407/why-utf-8-bom-bytes-efbbbf-can-be-replaced-by-ufeff
// FEFF is the BOM for UTF_16 (required by RFC 2781 for charsets)
assertEquals("feff" + ("123123123123".toBytes16().toNoPrefixHexString()), "123123123123".toByteArray(Charsets.UTF_16).toNoPrefixHexString())
assertEquals("feff" + ("123123123123".toBytes16().toHexString(false)), "123123123123".toByteArray(Charsets.UTF_16).toHexString(false))
assertArrayEquals("23".toCharArray().toBytes16(), "23".toBytes16() )