1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00
semantic/test/JSONTestCase.hs

32 lines
1.3 KiB
Haskell

{-# LANGUAGE DeriveAnyClass #-}
module JSONTestCase where
import Data.Map.Strict as Map
import Prelude
import Prologue
import Data.Aeson
data JSONMetaRepo = JSONMetaRepo { repoPath :: !String
, repoUrl :: !String
, language :: !String
, syntaxes :: ![JSONMetaSyntax]
} deriving (Show, Generic, FromJSON)
data JSONMetaSyntax = JSONMetaSyntax { syntax :: !String
, repoFilePath :: !String
, testCaseFilePath :: !String
, insert :: !String
, replacement :: !String
} deriving (Show, Generic, FromJSON)
data JSONTestCase = JSONTestCase { gitDir :: !String
, testCaseDescription :: !String
, filePaths :: ![String]
, sha1 :: !String
, sha2 :: !String
, expectedResult :: !(Map Text (Map Text [Value]))
} deriving (Show, Generic, FromJSON)
instance ToJSON JSONTestCase where
toEncoding = genericToEncoding defaultOptions