BnMcGn/gadgets

Issues in the tests in t/test-gadgets.lisp

Closed this issue · 1 comments

  1. The test with do-hash-table effectively assumes that do-hash-table scans the table in a specific order, but do-hash-table uses alexandria:hash-table-keys, which does not return the keys in a specific order, so it sometimes fails and sometimes doesn't.

  2. The test for use-package-with-shadowing assuming that the call to use-package-with-shadowing happens before reading the symbols in the following forms. That is true wen you load the source file, but not if you compile the file and load it, in which case the reading happens at compile time, and the call later at load time. It is better to do the reading at runtime e.g.

                    (is 2 (symbol-value (read-from-string "test1::var1")))
  1. Not really a problem, but make it easier to deal with errors: the macro prove-test:is is expecting the test form to be the first argument, and the expected result to be the second argument, so the for above should really be:
                    (is  (symbol-value (read-from-string "test1::var1"))  2)

When the form is first argument, if it causes an error it catches it and goes on the following tests. When it is second, it enters the debugger.

Fixes committed. I would appreciate verification as neither of these issues show up on my system. Thanks for the bug reports!