1+ {-# LANGUAGE ImplicitParams #-}
2+
13module Main where
24
35import qualified Analysis.Go.Spec
@@ -40,19 +42,18 @@ import Test.Hspec
4042import Test.Tasty as Tasty
4143import Test.Tasty.Hspec as Tasty
4244
43- tests :: TaskSession - > [TestTree ]
44- tests session =
45- [ Integration.Spec. spec session
45+ tests :: ( ? session :: TaskSession ) = > [TestTree ]
46+ tests =
47+ [ Integration.Spec. spec
4648 , Semantic.CLI.Spec. spec
4749 ]
4850
4951-- We can't bring this out of the IO monad until we divest
5052-- from hspec, since testSpec operates in IO.
51- allTests :: TaskSession -> IO TestTree
52- allTests session = do
53- let nativeSpecs = tests session
54- asTastySpecs <- Tasty. testSpecs $ legacySpecs session
55- let allSpecs = nativeSpecs <> asTastySpecs
53+ allTests :: (? session :: TaskSession ) => IO TestTree
54+ allTests = do
55+ asTastySpecs <- Tasty. testSpecs legacySpecs
56+ let allSpecs = tests <> asTastySpecs
5657 pure . Tasty. localOption Tasty. Success $ testGroup " semantic" allSpecs
5758
5859-- If you're writing new test modules, please don't add to this
@@ -61,15 +62,15 @@ allTests session = do
6162-- documentation: "hspec and tasty serve similar purposes; consider
6263-- using one or the other.") Instead, create a new TestTree value
6364-- in your spec module and add it to the above 'tests' list.
64- legacySpecs :: TaskSession - > Spec
65- legacySpecs args = do
65+ legacySpecs :: ( ? session :: TaskSession ) = > Spec
66+ legacySpecs = do
6667 describe " Semantic.Stat" Semantic.Stat.Spec. spec
6768 parallel $ do
68- describe " Analysis.Go" ( Analysis.Go.Spec. spec args)
69- describe " Analysis.PHP" ( Analysis.PHP.Spec. spec args)
70- describe " Analysis.Python" ( Analysis.Python.Spec. spec args)
71- describe " Analysis.Ruby" ( Analysis.Ruby.Spec. spec args)
72- describe " Analysis.TypeScript" ( Analysis.TypeScript.Spec. spec args)
69+ describe " Analysis.Go" Analysis.Go.Spec. spec
70+ describe " Analysis.PHP" Analysis.PHP.Spec. spec
71+ describe " Analysis.Python" Analysis.Python.Spec. spec
72+ describe " Analysis.Ruby" Analysis.Ruby.Spec. spec
73+ describe " Analysis.TypeScript" Analysis.TypeScript.Spec. spec
7374 describe " Assigning.Assignment" Assigning.Assignment.Spec. spec
7475 describe " Control.Abstract.Evaluator" Control.Abstract.Evaluator.Spec. spec
7576 describe " Data.Diff" Data.Diff.Spec. spec
@@ -101,6 +102,6 @@ legacySpecs args = do
101102main :: IO ()
102103main = do
103104 withOptions defaultOptions { optionsLogLevel = Nothing } $ \ config logger statter ->
104- let session = TaskSession config " -" False logger statter
105- in allTests session >>= defaultMain
105+ let ? session = TaskSession config " -" False logger statter
106+ in allTests >>= defaultMain
106107
0 commit comments