2020-02-04 00:58:24 +03:00
|
|
|
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
|
|
|
|
module Main (main) where
|
|
|
|
|
2020-02-07 00:28:46 +03:00
|
|
|
import AST.Test
|
2020-02-04 00:58:24 +03:00
|
|
|
import AST.Unmarshal
|
2020-02-20 21:01:46 +03:00
|
|
|
import qualified Language.Go.AST as Go
|
|
|
|
import Language.Go.Grammar
|
|
|
|
import qualified System.Path as Path
|
|
|
|
import Test.Tasty
|
2020-02-04 00:58:24 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main
|
2020-02-20 21:38:52 +03:00
|
|
|
= Path.absDir <$> Go.getTestCorpusDir
|
|
|
|
>>= readCorpusFiles'
|
2020-02-04 00:58:24 +03:00
|
|
|
>>= traverse (testCorpus parse)
|
|
|
|
>>= defaultMain . tests
|
|
|
|
where parse = parseByteString @Go.SourceFile @() tree_sitter_go
|
|
|
|
|
|
|
|
tests :: [TestTree] -> TestTree
|
|
|
|
tests = testGroup "tree-sitter-go corpus tests"
|