1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 12:21:57 +03:00
semantic/semantic-typescript/test/Test.hs
2020-02-06 16:30:47 -05:00

20 lines
664 B
Haskell

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