smyrman/units

Imporove test coverage

smyrman opened this issue · 1 comments

We should improve the test coverage of the various packages. With more reasoning below, the following should have tests:

  • All code that is not generated should have full test coverage.
  • The list of constants from the generate.json files should be tested.
  • Each "class" of generated functions should have (at least) one test (per type).

With code generation, the risk of human blunders have reduced significantly. Most of the code is generated by for-loops, that only varies which constant to use E.g. Meters(), Centimeters(), Feet() etc. for the linear.Distance type. Rather than having a percentage goal for how high the test coverage should be, it makes more sense to have a goal on what to test. For the auto-generated code, it should be enough to test one of the functions generated per for-loop, as well as ensuring that the constant list itself does not contain any errors. For what little code is not generated, full test coverage should not be to much work.

This must have been closed by mistake.