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:
parent
618cf71513
commit
318124a9f1
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user