unit tests now using hex utils
This commit is contained in:
parent
6e405b25f0
commit
d48c321868
|
@ -104,6 +104,7 @@ dependencies {
|
||||||
|
|
||||||
compileOnly("org.tukaani:xz:1.9") // LZMA support, optional
|
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("io.netty:netty-buffer:4.1.96.Final")
|
||||||
testImplementation("com.esotericsoftware:kryo:5.5.0")
|
testImplementation("com.esotericsoftware:kryo:5.5.0")
|
||||||
testImplementation("org.lz4:lz4-java:1.8.0")
|
testImplementation("org.lz4:lz4-java:1.8.0")
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package dorkbox.bytes
|
package dorkbox.bytes
|
||||||
|
|
||||||
|
import dorkbox.hex.hexToByteArray
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package dorkbox.bytes
|
package dorkbox.bytes
|
||||||
|
|
||||||
|
import dorkbox.hex.toHexString
|
||||||
import org.junit.Assert.*
|
import org.junit.Assert.*
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.File
|
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
|
// 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)
|
// 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() )
|
assertArrayEquals("23".toCharArray().toBytes16(), "23".toBytes16() )
|
||||||
|
|
Loading…
Reference in New Issue