avh4/elm-format

Reorganize test suite

Open

#429 geöffnet am 24. Nov. 2017

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Haskell (148 Forks)batch import
help wantedmaintenance

Repository-Metriken

Stars
 (1.329 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

(help wanted: I'd love to have help with this, but if you're interested, please coordinate with me about it, since it will affect a lot of parts of codebase)

Goals:

  • portable (prefer haskell over shell scripts)
  • easy to add new tests
  • easy to find all tests that relate to a particular syntax
  • fast (both quick to run, and quick to recompile while developing)
  • easy to see what the failure is when a test fails

New tests should:

  • allow input Elm code specified as text
  • allow expected output (formatted) Elm code specified as text
  • (future) allow expected AST to be specified as JSON text
  • be written in Haskell (not depend on bash scripts)

New tests probably should:

  • allow examples to be specified for individual AST node types (instead of having all tests specify fully-valid Elm source files)
  • allow example input/output to be specified in text files instead of being inline in haskell files
  • (future) somehow be associated to the syntax/format documentation

maybe should:

  • organize formatting code for each AST type next to the corresponding parser

Lessons learned:

  • testing parser by having tests that verify haskell AST output is too hard to maintain

Contributor Guide