about summary refs log tree commit diff
path: root/assessments/semiprimes
diff options
context:
space:
mode:
Diffstat (limited to 'assessments/semiprimes')
-rw-r--r--assessments/semiprimes/server/lib/server.ex4
-rw-r--r--assessments/semiprimes/server/test/server_test.exs3
2 files changed, 4 insertions, 3 deletions
diff --git a/assessments/semiprimes/server/lib/server.ex b/assessments/semiprimes/server/lib/server.ex
index c4088fb20ab5..7ab5e905b5a0 100644
--- a/assessments/semiprimes/server/lib/server.ex
+++ b/assessments/semiprimes/server/lib/server.ex
@@ -16,11 +16,11 @@ defmodule Server do
 
           res ->
             Cache.put(n, res)
-            res
+            {:miss, res}
         end
 
       hit ->
-        hit
+        {:hit, hit}
     end
   end
 
diff --git a/assessments/semiprimes/server/test/server_test.exs b/assessments/semiprimes/server/test/server_test.exs
index f327efb33abb..08d559734b5a 100644
--- a/assessments/semiprimes/server/test/server_test.exs
+++ b/assessments/semiprimes/server/test/server_test.exs
@@ -4,6 +4,7 @@ defmodule ServerTest do
 
   describe "semiprime" do
     test "returns the factors when the number is semiprime" do
+      Cache.clear()
       # Semiprimes below 30
       [
         {4, [2, 2]},
@@ -18,7 +19,7 @@ defmodule ServerTest do
         {26, [2, 13]}
       ]
       |> Enum.each(fn {input, expected} ->
-        assert Server.semiprime(input) == expected
+        assert Server.semiprime(input) == {:miss, expected}
       end)
     end