print begin
build / build (push) Successful in 1m13s

This commit is contained in:
2026-08-21 16:25:04 -06:00
parent 66386cda64
commit c340ede84f
11 changed files with 76 additions and 13 deletions
+25 -5
View File
@@ -19,11 +19,31 @@ tcaseW width name ast =
(pure $ Sut.printDatumW width ast)
id
thinWide name x = testGroup name
[ tcase (name <> "-wide") x
, tcaseW 4 (name <> "-thin") x
]
datumBegin xs = S.indentWith (S.NSpecial 0) . S.List $
(S.adorn S.SynBuiltin . S.Symbol $ "begin") : xs
datumLambda formals body =
S.indentWith (S.NSpecial 1) . S.List $
(S.adorn S.SynBuiltin . S.Symbol $ "lambda") : formals : body
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
]
, thinWide "simple-list" $
S.List [ S.Symbol s | s <- ["","","",""] ]
, thinWide "begin-nonempty" $
S.indentWith (S.NSpecial 0) $
datumBegin [ S.Symbol "책을"
, S.Symbol ""
, S.Symbol "먹으세요~!"
]
, thinWide "lambda" $
datumLambda (S.List [S.Symbol "어간", S.Symbol "어미"])
[ S.List [S.Symbol "display", S.Symbol "꾸깃"] ]
, tcase "rainbow" $
S.List [S.List [S.List [S.List [S.List []]]]]
]