1
1
mirror of https://github.com/github/semantic.git synced 2024-11-27 03:09:48 +03:00

Fix JSON stuff.

This commit is contained in:
Patrick Thomson 2020-07-01 20:59:33 -04:00
parent 618cf71513
commit 318124a9f1
3 changed files with 18 additions and 7 deletions

View File

@ -47,6 +47,8 @@ common haskell
-Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
cpp-options:
-DBAZEL_BUILD=0
library
import: haskell

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
@ -11,11 +12,18 @@ import qualified System.Path as Path
import Test.Tasty
main :: IO ()
main
= Path.absDir <$> JSON.getTestCorpusDir
>>= readCorpusFiles'
>>= traverse (testCorpus parse)
>>= defaultMain . tests
main = do
#if BAZEL_BUILD
rf <- Fixture.create
let ?project = Path.relDir "external/semantic-json"
?runfiles = rf
let dirs = Fixture.absRelDir "corpus"
#else
dirs <- Path.absRel <$> JSON.getTestCorpusDir
#endif
readCorpusFiles' dirs
>>= traverse (testCorpus parse)
>>= defaultMain . tests
where parse = parseByteString @(JSON.Document) @() tree_sitter_json
tests :: [TestTree] -> TestTree

View File

@ -1,4 +1,5 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
{-# LANGUAGE CPP, DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
module Main (main) where
@ -18,7 +19,7 @@ main = do
?runfiles = rf
let dirs = Fixture.absRelDir "tsx/corpus"
#else
dirs <- Path.absRel <$> Typescript.getTestCorpusDir
dirs <- Path.absRel <$> Tsx.getTestCorpusDir
#endif
readCorpusFiles' dirs