summary refs log tree commit diff
path: root/lib/either.test.fnl
diff options
context:
space:
mode:
authordozens2024-06-20 09:17:06 -0600
committerdozens2024-06-20 09:17:06 -0600
commitc7b2c982004e350f5e3032321baadfc9021b6bad (patch)
tree3f8883c94bed5a1f847cf60cb11207ca53946c67 /lib/either.test.fnl
parentce09973e7cacccdc779f91b8e6e48a520b9f9f4d (diff)
🗄️ big tidy up
- isolate core game logic and move it to src/game.fnl
- main.fnl should be just the ui now
- move all table funcs into lib/table
- move all (1) string funcs into lib/string
- move all game funcs into lib/game/
Diffstat (limited to 'lib/either.test.fnl')
-rw-r--r--lib/either.test.fnl72
1 files changed, 32 insertions, 40 deletions
diff --git a/lib/either.test.fnl b/lib/either.test.fnl
index 8ae0c08..5a29ea7 100644
--- a/lib/either.test.fnl
+++ b/lib/either.test.fnl
@@ -1,41 +1,33 @@
-(let [{: pprint} (require :lib.tableprint)
-      {: describe :end test-end} (require :lib.test)
+(let [{:print pprint} (require :lib.table)
+      {: describe : test-end} (require :lib.test)
       {: Either : Left : Right } (require :lib.either)]
-  (describe "Either" (fn [t]
-                       (t {:given "a new either"
-                           :should "set its value correctly"
-                           :expected :poop
-                           :actual (. (Either:new :poop) :value)
-                           })
-                       (t
-                        (let [r (Right:new "rain")
-                              map (r:map #(.. "b" $1))
-                              expected :brain
-                              actual (. map :value)]
-                          {:given "a Right of some value"
-                           :should "map"
-                           expected
-                           actual
-                           }))
-                       (t
-                        (let [ l (Left:new "rain")
-                              map (l:map #(.. "b" $1))
-                              expected :rain
-                              actual (. map :value)
-                              ]
-                          {:given "a Left of some value"
-                           :should "not map"
-                           expected
-                           actual
-                           }))
-                       (t
-                        (let [ e (Either.of "rank")
-                              map (e:map #(.. "f" $1))
-                              expected :frank
-                              actual (. map :value) ]
-                          {:given "Either.of"
-                           :should "map"
-                           expected
-                           actual
-                           }))
-                       (test-end))))
+  (describe "# EITHER" (fn [t]
+    (t {:given "a new either"
+        :should "set its value correctly"
+        :expected :poop
+        :actual (. (Either:new :poop) :value) })
+    (t (let [r (Right:new "rain")
+             map (r:map #(.. "b" $1))
+             expected :brain
+             actual (. map :value)]
+       {:given "a Right of some value"
+        :should "map"
+        expected
+        actual }))
+    (t (let [ l (Left:new "rain")
+              map (l:map #(.. "b" $1))
+              expected :rain
+              actual (. map :value) ]
+       {:given "a Left of some value"
+        :should "not map"
+        expected
+        actual }))
+    (t (let [ e (Either.of "rank")
+              map (e:map #(.. "f" $1))
+              expected :frank
+              actual (. map :value) ]
+       {:given "Either.of"
+        :should "map"
+        expected
+        actual }))
+    (test-end))))