2020-02-04 21:58:34 +03:00
|
|
|
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
|
|
|
|
module Main (main) where
|
|
|
|
|
2020-02-07 00:30:44 +03:00
|
|
|
import AST.Test
|
|
|
|
import AST.Unmarshal
|
2020-02-20 21:01:46 +03:00
|
|
|
import qualified Language.TSX.AST as Tsx
|
|
|
|
import Language.TSX.Grammar
|
|
|
|
import qualified System.Path as Path
|
|
|
|
import Test.Tasty
|
2020-02-04 21:58:34 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main
|
|
|
|
= readCorpusFiles (Path.relDir "tree-sitter-tsx/vendor/tree-sitter-typescript/tsx/corpus")
|
|
|
|
>>= traverse (testCorpus parse)
|
|
|
|
>>= defaultMain . tests
|
2020-02-20 21:01:46 +03:00
|
|
|
where parse = parseByteString @Tsx.Program @() tree_sitter_tsx
|
2020-02-04 21:58:34 +03:00
|
|
|
|
|
|
|
tests :: [TestTree] -> TestTree
|
|
|
|
tests = testGroup "tree-sitter-tsx corpus tests"
|