primary source of my static site generator for my blog, the github link is a mirror for github actions
Find a file
Pagwin 628f01217e
restructure the tests and assert on whole trees
The suite is now one tasty binary over shared modules, so the Djot
tests can sit next to the Markdown ones without another copy of the
harness:

  tests/Main.hs             the TestTree
  tests/Test/Harness.hs     running a parser inside a property
  tests/Test/Gen.hs         generators, shrinkers, escaping
  tests/Test/Gen/Document.hs  whole document generation
  tests/Markdown/Parse.hs   the Markdown properties

Generated values moved from `pick` to `Arbitrary` instances on
newtypes. `pick` embeds its value with `forAll (return a)` and cannot
shrink; going through Arbitrary gets shrinking back at the cost of
hand written shrinkers, which have to preserve the invariants their
generator established.

IR now derives Eq, and the properties assert against a complete
expected tree rather than pattern matching. The old patterns bound
fresh names that shadowed the generated ones, so they only ever
checked the shape of the tree and never its content.

Test.Gen.Document generates a description of a document which renders
to source and derives its own expected tree, so the two stay in step
while shrinking. Rendering goes through a Syntax record so Djot can
reuse the spec and the expectations. Escaping is a generator level
concern: an Escaper says which characters are special and how (or
whether) they can be written literally.

Two properties fail, both on parser bugs rather than test bugs:

  code_block          fencedCodeBlock inverts its language test, so a
                      fence naming a language reports Nothing. Djot.hs
                      gets this right at src/Djot.hs:354.
  document_round_trip a nested list with more than one item makes the
                      whole list fail to parse and fall back to a
                      paragraph. In listBlock's child parser the second
                      alternative has no `try`, so it fails having
                      consumed the first item's indentation. The
                      existing nesting tests only ever used one nested
                      item.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 16:15:33 -04:00
.github/workflows version bump due to being close to the point where I'll start using this 2025-11-26 21:02:22 -05:00
app moved everything into src for ease of testing 2025-12-05 19:42:15 -05:00
src restructure the tests and assert on whole trees 2026-09-04 16:15:33 -04:00
tests restructure the tests and assert on whole trees 2026-09-04 16:15:33 -04:00
.dockerignore added .git to .dockerignore 2025-12-13 18:52:41 -05:00
.gitignore swap hedgehog out for QuickCheck 2026-09-04 15:39:36 -04:00
action.yml updated action.yml 2025-12-13 20:00:45 -05:00
CHANGELOG.md changelog 2025-12-13 20:06:26 -05:00
Dockerfile fixed docker issues 2026-02-26 01:32:12 -05:00
LICENSE initial commit after moving out of repo 2024-07-20 16:49:21 -04:00
psb.cabal restructure the tests and assert on whole trees 2026-09-04 16:15:33 -04:00
TODO.md some TODO planning 2026-05-05 15:07:27 -04:00