From 708c0c523df97d1542b7b6d128c5218f6e2cc460 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 21 Nov 2014 00:48:10 -0800 Subject: Move things around a bit --- test/ConversionUtilsSpec.scala | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/ConversionUtilsSpec.scala (limited to 'test/ConversionUtilsSpec.scala') diff --git a/test/ConversionUtilsSpec.scala b/test/ConversionUtilsSpec.scala new file mode 100644 index 0000000..d6c17b3 --- /dev/null +++ b/test/ConversionUtilsSpec.scala @@ -0,0 +1,31 @@ +package ixee.cryptopals.test + +import com.ixee.IxeeSpec +import org.scalatest._ + +class ConversionUtilsSpec extends FreeSpec with MustMatchers { + + import ixee.cryptopals.utils.ConversionUtils._ + + "ConversionUtils" - { + ".hexStr2Bytes" - { + "converts a hexadecimal string to an equivalent iterator of bytes" - { + hexStr2Bytes("12348765").toArray must equal( + Array[Byte]( + 0x12.toByte, + 0x34.toByte, + 0x87.toByte, + 0x65.toByte + ) + ) + } + + "when the string is not an even length" - { + "prepends a 0" - { + hexStr2Bytes("2123").toArray must equal(hexStr2Bytes("0123").toArray) + } + } + } + } + +} -- cgit v1.1