2020-03-04 20:04:02 +03:00
|
|
|
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
|
|
|
|
module Main (main) where
|
|
|
|
|
|
|
|
import qualified System.Path as Path
|
|
|
|
import Test.Tasty
|
2020-03-19 23:33:36 +03:00
|
|
|
import qualified Language.CodeQL.AST as CodeQL
|
|
|
|
import Language.CodeQL.Grammar
|
2020-03-04 20:04:02 +03:00
|
|
|
import AST.Test
|
|
|
|
import AST.Unmarshal
|
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main
|
2020-03-19 23:33:36 +03:00
|
|
|
= Path.absDir <$> CodeQL.getTestCorpusDir
|
2020-03-04 20:04:02 +03:00
|
|
|
>>= readCorpusFiles'
|
|
|
|
>>= traverse (testCorpus parse)
|
|
|
|
>>= defaultMain . tests
|
2020-03-28 01:27:07 +03:00
|
|
|
where parse = parseByteString @CodeQL.Ql @() tree_sitter_ql
|
2020-03-04 20:04:02 +03:00
|
|
|
|
|
|
|
tests :: [TestTree] -> TestTree
|
2020-03-05 04:07:48 +03:00
|
|
|
tests = testGroup "tree-sitter-ql corpus tests"
|