haskell / stylish-haskell

Haskell code prettifier
Other
987 stars 151 forks source link

Provide mechanism for golden tests #258

Open EncodePanda opened 4 years ago

EncodePanda commented 4 years ago

In order to easier maintain the project we should consider providing golden test mechanism.

Proposal

  1. there would be dedicated golden folder in tests
  2. in that folder for each feature you are trying to test you would provide:
    • featurename-input.hs
    • featurename-output.hs
    • featurename-config.yaml
  3. The mechanism would run stylish-haskell against provided input file and configuration and compare . results with output file

Benefits:

  1. This should simplify testing process (matter of adding yet another golden test)
  2. We could expect community to attach golden files whenever they are requesting a feature or informing about a bug ("this is the source that i have, this is the output i would like to see"). Issue than would not be considered resolved until the golden test provided is not added to golden folder and that test is not passing
jaspervdj commented 4 years ago

Very much in favor!