about summary refs log tree commit diff
path: root/test/Xanthous/Data/NestedMapSpec.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2020-05-25T15·21-0400
committerGriffin Smith <root@gws.fyi>2020-05-25T15·21-0400
commitdb6ea025818b2212725442a733ad02d4b5188d2a (patch)
treef04282ce40f8ca5584b17dd3c2ba29a1979e49b0 /test/Xanthous/Data/NestedMapSpec.hs
parent2c86856ca7784483a7cdd438763b2693a297908a (diff)
Begin a broken-out NestedMap type
Begin breaking out a NestedMap data structure, which existed in both the
variables for the new template system and the structure that stored
messages.
Diffstat (limited to 'test/Xanthous/Data/NestedMapSpec.hs')
-rw-r--r--test/Xanthous/Data/NestedMapSpec.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Xanthous/Data/NestedMapSpec.hs b/test/Xanthous/Data/NestedMapSpec.hs
new file mode 100644
index 000000000000..acf7a67268f4
--- /dev/null
+++ b/test/Xanthous/Data/NestedMapSpec.hs
@@ -0,0 +1,20 @@
+--------------------------------------------------------------------------------
+module Xanthous.Data.NestedMapSpec (main, test) where
+--------------------------------------------------------------------------------
+import           Test.Prelude
+--------------------------------------------------------------------------------
+import           Test.QuickCheck.Instances.Semigroup ()
+--------------------------------------------------------------------------------
+import qualified Xanthous.Data.NestedMap as NM
+--------------------------------------------------------------------------------
+
+main :: IO ()
+main = defaultMain test
+
+test :: TestTree
+test = testGroup "Xanthous.Data.NestedMap"
+  [ testProperty "insert/lookup" $ \nm ks v ->
+      let nm' = NM.insert ks v nm
+      in counterexample ("inserted: " <> show nm')
+         $ NM.lookup @Map @Int @Int ks nm' === Just (NM.Val v)
+  ]