2020-02-04 20:33:52 +03:00
|
|
|
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications #-}
|
|
|
|
module Main (main) where
|
|
|
|
|
2020-02-07 00:30:39 +03:00
|
|
|
import AST.Test
|
|
|
|
import AST.Unmarshal
|
2020-02-20 21:01:46 +03:00
|
|
|
import qualified Language.Ruby.AST as Rb
|
|
|
|
import Language.Ruby.Grammar
|
|
|
|
import qualified System.Path as Path
|
|
|
|
import Test.Tasty
|
2020-02-04 20:33:52 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main
|
2020-02-21 00:47:23 +03:00
|
|
|
= Path.absDir <$> Rb.getTestCorpusDir
|
|
|
|
>>= readCorpusFiles'
|
2020-02-04 20:33:52 +03:00
|
|
|
>>= traverse (testCorpus parse)
|
|
|
|
>>= defaultMain . tests
|
|
|
|
where parse = parseByteString @Rb.Program @() tree_sitter_ruby
|
|
|
|
|
|
|
|
tests :: [TestTree] -> TestTree
|
|
|
|
tests = testGroup "tree-sitter-ruby corpus tests"
|