basic love

This commit is contained in:
2025-11-26 16:20:31 +09:00
parent 7bf66c6de0
commit 68adfeb1d8
16 changed files with 308 additions and 73 deletions

16
test/Data/TypesSpec.hs Normal file
View File

@@ -0,0 +1,16 @@
module Data.TypesSpec (spec) where
import Data.Types (UserId (..))
import Serialize.Str
import Test.Hspec
spec :: Spec
spec = describe "userId StringTrans" $ do
it "fromStr should convert String to UserId::Discord" $ do
fromStr "d:muffin" `shouldBe` Just (Discord "muffin")
it "fromStr should fail conversion" $ do
(fromStr "muffin" :: Maybe UserId) `shouldBe` Nothing
it "toStr should convert UserId to String" $ do
toStr (Discord "muffin") `shouldBe` "d:muffin"