From 62f1fe9b3ec2a5c05c49acbf47356c28a9b73f61 Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 26 Nov 2014 00:21:44 -0800 Subject: Challenge 6 --- test/StreamUtilsSpec.scala | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/StreamUtilsSpec.scala (limited to 'test') diff --git a/test/StreamUtilsSpec.scala b/test/StreamUtilsSpec.scala new file mode 100644 index 0000000..b9a710c --- /dev/null +++ b/test/StreamUtilsSpec.scala @@ -0,0 +1,38 @@ +package ixee.cryptopals.test + +import com.ixee.IxeeSpec +import ixee.cryptopals.utils.StreamUtils + +class StreamUtilsSpec extends IxeeSpec { + + "StreamUtils" - { + + ".fromSeq" - { + "is better written as xs.to[Stream]" in { } +/* + "streams the given Seq's elements non-cyclically" in { + + StreamUtils.fromSeq(Seq(1, 2, 3)) mustBe + (1 #:: 2 #:: 3 #:: Stream.empty) + + } +*/ + } + + ".continuous" - { + + "streams the given Seq's elements cyclically" in { + + assert( + StreamUtils.continuous(Seq(1, 2)).startsWith( + Seq(1, 2, 1, 2) + ) + ) + + } + + } + + } + +} -- cgit v1.1