1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00
semantic/semantic-json/test/Test.hs

20 lines
622 B
Haskell

{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
module Main (main) where
import qualified System.Path as Path
import Test.Tasty
import TreeSitter.JSON
import qualified TreeSitter.JSON.AST as JSON
import AST.Test
import AST.Unmarshal
main :: IO ()
main
= readCorpusFiles (Path.relDir "tree-sitter-json/vendor/tree-sitter-json/corpus")
>>= traverse (testCorpus parse)
>>= defaultMain . tests
where parse = parseByteString @JSON.Document @() tree_sitter_json
tests :: [TestTree] -> TestTree
tests = testGroup "tree-sitter-json corpus tests"