josherrickson / rlemon

rlemon - R interface to C++ LEMON graph library
http://errickson.net/rlemon/
8 stars 3 forks source link

testing standardization #31

Closed josherrickson closed 2 years ago

josherrickson commented 2 years ago

For testing, I'd like to see the following standardized such that each exported function has the following tests.

  1. Ensure runner functions run without error and return the "expected objects".
  2. Ensure exported functions run without error and return the "expected objects".
  3. Ensure exported functions with algorithm=default runs without error, and returns the same if passed no argument.
  4. Ensure exported functions work with all valid algorithms.
  5. Ensure exported functions fail if passed an invalid algorithm.

Currently 1 & 2 seem fairly well tested, 3 is not tested (see #29 for an example of where tests should have helped us), 4 & 5 are mostly tested. Let's try and get these all to "are completely tested" status.

Note: Expected object focused on a) type (e.g. vector, list?) and b) size. We should move away from testing the explicit values.

Edit: 2. and 4. should be tested with both default arguments (if given) and specific values.

josherrickson commented 2 years ago

See above commit for a template.