Skip to content

Commit

Permalink
🧩 [rename]: testWithSetup -> test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyp committed Oct 5, 2023
1 parent fccff33 commit f6d8079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/Many.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Benchmark.Util (BenchRow)
import Data.Array (zip)
import Effect.Aff (Aff)
import Module (File(..), Folder(..), datasetAs, defaultImports, loadFile)
import Test.Util (TestBwdSpec, TestLinkSpec, TestSpec, TestWithDatasetSpec, checkPretty, testWithSetup)
import Test.Util (TestBwdSpec, TestLinkSpec, TestSpec, TestWithDatasetSpec, checkPretty, test)
import Util (type (×))

many :: Array TestSpec -> Int -> Array (String × Aff BenchRow)
many specs n = zip (specs <#> _.file) (specs <#> one)
where
one { file, fwd_expect } = do
progCxt <- defaultImports
testWithSetup n (File file) progCxt { δv: identity, fwd_expect, bwd_expect: mempty }
test n (File file) progCxt { δv: identity, fwd_expect, bwd_expect: mempty }

bwdMany :: Array TestBwdSpec -> Int -> Array (String × Aff BenchRow)
bwdMany specs n = zip (specs <#> _.file) (specs <#> one)
Expand All @@ -24,14 +24,14 @@ bwdMany specs n = zip (specs <#> _.file) (specs <#> one)
one { file, file_expect, δv, fwd_expect } = do
progCxt <- defaultImports
bwd_expect <- loadFile (Folder "fluid/example") (folder <> File file_expect)
testWithSetup n (folder <> File file) progCxt { δv, fwd_expect, bwd_expect }
test n (folder <> File file) progCxt { δv, fwd_expect, bwd_expect }

withDatasetMany :: Array TestWithDatasetSpec -> Int -> Array (String × Aff BenchRow)
withDatasetMany specs n = zip (specs <#> _.file) (specs <#> one)
where
one { dataset, file } = do
progCxt <- defaultImports >>= datasetAs (File dataset) "data"
testWithSetup n (File file) progCxt { δv: identity, fwd_expect: mempty, bwd_expect: mempty }
test n (File file) progCxt { δv: identity, fwd_expect: mempty, bwd_expect: mempty }

linkMany :: Array TestLinkSpec -> Array (String × Aff Unit)
linkMany specs = zip (specs <#> name) (specs <#> one)
Expand Down
4 changes: 2 additions & 2 deletions test/Util.purs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ type TestConfig =
logging :: Boolean
logging = false

testWithSetup ∷ Int -> File -> ProgCxt Unit -> TestConfig -> Aff BenchRow
testWithSetup n file progCxt tconfig = do
test ∷ Int -> File -> ProgCxt Unit -> TestConfig -> Aff BenchRow
test n file progCxt tconfig = do
gconfig <- initialConfig progCxt
s <- open file
testPretty s
Expand Down

0 comments on commit f6d8079

Please sign in to comment.