test: Testing caught me doing stupid stuff

This commit is contained in:
vegowotenks 2025-08-22 10:04:23 +02:00
parent cff27337e7
commit c78d261a1b
7 changed files with 87 additions and 6 deletions

View file

@ -0,0 +1,17 @@
{-# LANGUAGE TemplateHaskell #-}
module Test.Language.Json.Type (testGroup) where
import qualified Language.Json.Type as Type
import qualified Language.Json as Json
import Test.QuickCheck (allProperties, Property)
import qualified Test.Tasty.QuickCheck as Tasty.QuickCheck
import Test.Tasty (TestTree)
prop_inferredTypeConformsSourceValue :: Json.PrintableValue -> Bool
prop_inferredTypeConformsSourceValue (Json.PrintableValue value) = null (Type.conforms (Type.infer value) value)
return [] -- make ghc 'commit' already defined values
properties :: [(String, Property)]
properties = $allProperties
testGroup :: TestTree
testGroup = Tasty.QuickCheck.testProperties "Language.Json.Type" properties