summaryrefslogtreecommitdiff
path: root/test/ByteUtilsSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/ByteUtilsSpec.scala')
-rw-r--r--test/ByteUtilsSpec.scala85
1 files changed, 85 insertions, 0 deletions
diff --git a/test/ByteUtilsSpec.scala b/test/ByteUtilsSpec.scala
new file mode 100644
index 0000000..8c7c7c9
--- /dev/null
+++ b/test/ByteUtilsSpec.scala
@@ -0,0 +1,85 @@
+package ixee.cryptopals.test
+
+import ixee.cryptopals.utils.ByteUtils
+
+import com.ixee.IxeeSpec
+
+class ByteUtilsSpec extends IxeeSpec {
+
+ "ByteUtils" - {
+
+ "SizedNumeric" - {
+
+ ".liftedTo" - {
+
+ "when the destination is >= the source in range" - {
+
+ "losslessly converts to the destination type" - {
+
+ }
+
+ }
+
+ "when the destination is smaller than the source" - {
+
+ "throws an exception TODO: make it a Try?" - {
+
+ }
+
+ }
+
+ }
+
+ ".truncatedTo" - {
+
+ "converts to the target type, truncating extra bytes" - {
+
+ }
+
+ }
+
+ ".byteSize" - {
+
+ "returns the size of a the type, in bytes" - {
+
+ }
+
+ }
+
+ ".bitSize" - {
+
+ "returns the size of a type, in bits" - {
+
+ }
+
+ }
+
+ }
+
+ "BitOps" - {
+
+ "provides typed operations that don't upcast to Int" - {
+
+ }
+
+ }
+
+ "toByteArray TODO: toByteSeq?" - {
+
+ "returns the value as an array of bytes TODO: endianness?" - {
+
+ }
+
+ }
+
+ "toBinaryString" - {
+
+ "returns the value as a string of 1s and 0s, padded to the full size" - {
+
+ }
+
+ }
+
+ }
+
+}