BAPCtools icon indicating copy to clipboard operation
BAPCtools copied to clipboard

Generator tests

Open RagnarGrootKoerkamp opened this issue 9 months ago • 0 comments

Sometimes generators have bugs where they generate valid but unintended data, and you only find them after a while by inspecting the generated .in files manually.

Maybe we could come up with some simple and clean way to test that generators do what was intended. Maybe something like the following in generators.yaml:

tests:
  - command: linear_sequence.py 10 5
    contains: 
      - "0 5 10"
      - "45 50\n"

On the other hand, I'm not exactly sure how useful it is to only be able test for substring containment. But writing code to detect arbitrary patterns and executing that sounds like a lot of overhead.

RagnarGrootKoerkamp avatar Sep 20 '23 14:09 RagnarGrootKoerkamp