wip: printer
build / build (push) Successful in 1m33s

This commit is contained in:
2026-08-21 15:01:31 -06:00
parent 6ff01a8607
commit b234a52d4b
40 changed files with 341 additions and 221 deletions
+2 -2
View File
@@ -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"
+29
View File
@@ -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
]
]