@@ -68,7 +68,6 @@ import Primer.Typecheck (SmartHoles (SmartHoles))
6868import System.FilePath (takeBaseName )
6969import Test.Tasty hiding (after )
7070import Test.Tasty.Golden
71- import Test.Tasty.HUnit
7271
7372-- | Check that encoding the value produces the file.
7473test_encode :: TestTree
@@ -82,18 +81,11 @@ test_encode =
8281 encodePretty :: ToJSON a => a -> BL. ByteString
8382 encodePretty = encodePretty' $ defConfig{confCompare = compare }
8483
85- -- | Check that decoding the file produces the value.
86- test_decode :: TestTree
87- test_decode =
88- testGroup " decode" $
89- fixtures <&> \ (Fixture x path) ->
90- testCase (takeBaseName path) $ either assertFailure (x @=? ) =<< eitherDecodeFileStrict path
91-
9284-- | A fixture holds some value which is JSON serializable and path to a
9385-- fixture file which should contain a JSON representation of that value.
94- data Fixture = forall a . (Eq a , Show a , FromJSON a , ToJSON a ) => Fixture a FilePath
86+ data Fixture = forall a . (Eq a , Show a , ToJSON a ) => Fixture a FilePath
9587
96- mkFixture :: (Eq a , Show a , ToJSON a , FromJSON a ) => String -> a -> Fixture
88+ mkFixture :: (Eq a , Show a , ToJSON a ) => String -> a -> Fixture
9789mkFixture name x = Fixture x (" test/outputs/serialization/" <> name <> " .json" )
9890
9991-- | A list of fixtures we will test.
@@ -164,7 +156,7 @@ fixtures =
164156 , bodyID = id0
165157 , types = (TEmptyHole typeMeta, TEmptyHole typeMeta)
166158 }
167- in [ mkFixture " id" id0
159+ in [ mkFixture " id" id0 -- TODO this does still have a FromJSON instance
168160 , mkFixture " name" (unsafeMkName " x" )
169161 , mkFixture " movement" Child1
170162 , mkFixture " action" (SetCursor id0)
@@ -173,7 +165,7 @@ fixtures =
173165 , mkFixture " typecache" (TCSynthed $ TEmptyHole () )
174166 , mkFixture " typecacheboth" (TCBoth (TEmptyHole () ) (TEmptyHole () ))
175167 , mkFixture " expr" expr
176- , mkFixture " kind" KType
168+ , mkFixture " kind" KType -- TODO this does still have a FromJSON instance
177169 , mkFixture " log" log
178170 , mkFixture " def" def
179171 , mkFixture " typeDef" typeDef
0 commit comments