1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Update semantic-ql to use tree-sitter-ql package from hackage

This commit is contained in:
Rick Winfrey 2020-03-04 09:04:02 -08:00
parent b54c022b28
commit df4ffa8691
3 changed files with 41 additions and 1 deletions

View File

@ -31,7 +31,7 @@ common haskell
, template-haskell ^>= 2.15
, text ^>= 1.2.3
, tree-sitter ^>= 0.9
, tree-sitter-ql
, tree-sitter-ql ^>= 0.1.0.0
ghc-options:
-Weverything

View File

@ -0,0 +1,20 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
module Main (main) where
import qualified System.Path as Path
import Test.Tasty
import qualified Language.QL.AST as QL
import Language.QL.Grammar
import AST.Test
import AST.Unmarshal
main :: IO ()
main
= Path.absDir <$> QL.getTestCorpusDir
>>= readCorpusFiles'
>>= traverse (testCorpus parse)
>>= defaultMain . tests
where parse = parseByteString @QL.Module @() tree_sitter_ql
tests :: [TestTree] -> TestTree
tests = testGroup "tree-sitter-python corpus tests"

20
semantic-ql/test/Test.hs Normal file
View File

@ -0,0 +1,20 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
module Main (main) where
import AST.Test
import AST.Unmarshal
import qualified Language.QL.AST as QL
import Language.QL.Grammar
import qualified System.Path as Path
import Test.Tasty
main :: IO ()
main
= Path.absDir <$> QL.getTestCorpusDir
>>= readCorpusFiles'
>>= traverse (testCorpus parse)
>>= defaultMain . tests
where parse = parseByteString @QL.Module @() tree_sitter_ruby
tests :: [TestTree] -> TestTree
tests = testGroup "tree-sitter-ruby corpus tests"