1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 08:27:56 +03:00

add Go test

This commit is contained in:
Ayman Nadeem 2020-02-03 16:58:24 -05:00
parent dd3b686d7c
commit ccd51b3be7

19
semantic-go/test/Test.hs Normal file
View File

@ -0,0 +1,19 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
module Main (main) where
import qualified System.Path as Path
import Test.Tasty
import Language.Go.Grammar
import qualified Language.Go.AST as Go
import TreeSitter.Test.Helpers
import AST.Unmarshal
main :: IO ()
main
= readCorpusFiles (Path.relDir "tree-sitter-go/vendor/tree-sitter-go/corpus")
>>= traverse (testCorpus parse)
>>= defaultMain . tests
where parse = parseByteString @Go.SourceFile @() tree_sitter_go
tests :: [TestTree] -> TestTree
tests = testGroup "tree-sitter-go corpus tests"