mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
32 lines
1.3 KiB
Haskell
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
|