@@ -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