haskell-foreign-rust/test/Test/Serialisation/Raw/Base64.hs

33 lines
802 B
Haskell
Raw Permalink Normal View History

2023-03-17 08:46:12 +00:00
{-# LANGUAGE TemplateHaskell #-}
module Test.Serialisation.Raw.Base64 (tests) where
import Test.Tasty
import Test.Tasty.HUnit
import qualified Data.Aeson as Aeson
import Test.Serialisation.Types
import Test.Util.TH
tests :: TestTree
tests = testGroup "Test.Serialisation.Raw.Base64" [
testCase "show" test_show
, testCase "structured" test_structured
, testCase "json" test_json
]
test_show :: Assertion
test_show =
assertEqual "" exampleUsesBase64 $
$(reparseShow exampleUsesBase64)
test_structured :: Assertion
test_structured =
assertEqual "" exampleUsesBase64 $
$(reparseStructured exampleUsesBase64)
test_json :: Assertion
test_json =
assertEqual "" (Right exampleUsesBase64) $
Aeson.eitherDecode $ Aeson.encode exampleUsesBase64