diff --git a/chapter01/src/test/scala/sofp/unit/Exercise1.1.scala b/chapter01/src/test/scala/sofp/unit/Exercise1.1.scala deleted file mode 100644 index af4a515..0000000 --- a/chapter01/src/test/scala/sofp/unit/Exercise1.1.scala +++ /dev/null @@ -1,13 +0,0 @@ -package sofp.unit - -import com.eed3si9n.expecty.Expecty.expect - -import munit.FunSuite - -class Exercise1_1 extends FunSuite { - - test("exercise 1.1") { - expect(0 == 0) - } - -} diff --git a/chapter01/src/test/scala/sofp/unit/Exercises_1_6_1.scala b/chapter01/src/test/scala/sofp/unit/Exercises_1_6_1.scala new file mode 100644 index 0000000..60b1e38 --- /dev/null +++ b/chapter01/src/test/scala/sofp/unit/Exercises_1_6_1.scala @@ -0,0 +1,17 @@ +package sofp.unit + +import com.eed3si9n.expecty.Expecty.expect + +import munit.FunSuite + +class Exercises_1_6_1 extends FunSuite { + + test("exercise 1.6.1.1") { + + def staggeredFactorial(n: Int): Int = (n to 1 by -2).product + + expect(staggeredFactorial(8) == 384) + expect(staggeredFactorial(9) == 945) + } + +}