diff --git a/exercises/practice/perfect-numbers/.meta/tests.toml b/exercises/practice/perfect-numbers/.meta/tests.toml index ec288891..81d48408 100644 --- a/exercises/practice/perfect-numbers/.meta/tests.toml +++ b/exercises/practice/perfect-numbers/.meta/tests.toml @@ -27,6 +27,9 @@ description = "Abundant numbers -> Medium abundant number is classified correctl [ec7792e6-8786-449c-b005-ce6dd89a772b] description = "Abundant numbers -> Large abundant number is classified correctly" +[05f15b93-849c-45e9-9c7d-1ea131ef7d10] +description = "Abundant numbers -> Perfect square abundant number is classified correctly" + [e610fdc7-2b6e-43c3-a51c-b70fb37413ba] description = "Deficient numbers -> Smallest prime deficient number is classified correctly" diff --git a/exercises/practice/perfect-numbers/test.sml b/exercises/practice/perfect-numbers/test.sml index 89602e58..7c897d37 100644 --- a/exercises/practice/perfect-numbers/test.sml +++ b/exercises/practice/perfect-numbers/test.sml @@ -27,7 +27,10 @@ val testsuite = (fn _ => classify 30 |> Expect.equalTo (SOME Abundant)), test "Large abundant number is classified correctly" - (fn _ => classify 33550335 |> Expect.equalTo (SOME Abundant)) + (fn _ => classify 33550335 |> Expect.equalTo (SOME Abundant)), + + test "Perfect square abundant number is classified correctly" + (fn _ => classify 196 |> Expect.equalTo (SOME Abundant)) ], describe "Deficient numbers" [ @@ -48,10 +51,10 @@ val testsuite = ], describe "Invalid inputs" [ - test "Zero is rejected (not a natural number)" + test "Zero is rejected (as it is not a positive integer)" (fn _ => classify 0 |> Expect.equalTo NONE), - test "Negative integer is rejected (not a natural number)" + test "Negative integer is rejected (as it is not a positive integer)" (fn _ => classify ~1 |> Expect.equalTo NONE) ] ]