@@ -93,9 +93,9 @@ stackifyTests files = do
|
||||
|
||||
test_reader :: IO TestTree
|
||||
test_reader = do
|
||||
all_cases <- listDirectory "golden/reader"
|
||||
all_cases <- listDirectory "golden/read"
|
||||
let tests = all_cases
|
||||
& fmap ("golden/reader"</>)
|
||||
& fmap ("golden/read"</>)
|
||||
pure . testGroup "reader" $ tests <&> \test ->
|
||||
let testname = takeFileName test
|
||||
scmfile = test </> "source.scm"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
module Gyehoek.Test.Sexp.Print where
|
||||
|
||||
import Test.Tasty (TestTree, testGroup, TestName)
|
||||
import Test.Tasty.HUnit
|
||||
import Gyehoek.Prelude
|
||||
import Gyehoek.Sexp.Syntax qualified as S
|
||||
import Gyehoek.Sexp.Print qualified as Sut
|
||||
import System.FilePath ((</>))
|
||||
import Test.Tasty.Silver
|
||||
|
||||
|
||||
tcase = tcaseW 80
|
||||
|
||||
tcaseW :: Int -> TestName -> S.Datum -> TestTree
|
||||
tcaseW width name ast =
|
||||
goldenVsAction
|
||||
name
|
||||
("golden/print" </> name)
|
||||
(pure $ Sut.printDatumW width ast)
|
||||
id
|
||||
|
||||
test_print = testGroup "sexp pretty printer" $
|
||||
[ tcase "null" $ S.List []
|
||||
, let x = S.List [ S.Symbol s | s <- ["가","나","다","라"] ]
|
||||
in testGroup "simple list"
|
||||
[ tcase "flat" x
|
||||
, tcaseW 4 "long" x
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user