Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
8e6912fe30 Add a more controllable test of terms with operators. 2022-08-29 22:24:09 +10:00
Zoltan Somogyi
8da84c4ee5 Make test_pretty_printer's output more checkable.
tests/hard_coded/test_pretty_printer.m:
tests/hard_coded/test_pretty_printer_helper.m:
    This test checks the operation of the library's pretty_printer module

    - on several docs, and
    - with several parameters.

    With the old organization of this test case, the output consisted of

    - all docs with the first set of parameter values,
    - all docs with the next set of parameter values,
    and so on.

    This diff reorders the output so that it now consists of

    - the first doc with all sets of parameter values,
    - the next doc with all sets of parameter values,
    and so on.

    This makes it much easier to check the output.

    The new approach also

    - gives a name to each doc,
    - prints the doc using the largest parameter values (longest lines,
      most lines allowed, etc) first, which allows all the later outputs
      for the same doc with smaller parameters values to be checked against
      it more easily.

    This diff also moves the code that serves as the infrastructure
    of the test case to the new module test_pretty_printer_helper.m,
    leaving test_pretty_printer.m to contain just the code that
    constructs the docs whose prettyprinting is to be tested. (Previously,
    these two classes of code were interleaved in the source code.)

tests/hard_coded/test_pretty_printer.exp:
    Expect the output in the updated order.
2022-07-25 07:13:17 +10:00