Git Product home page Git Product logo

Comments (4)

fixermark avatar fixermark commented on May 4, 2024 1

Root issue is that the framework bundles the tests into a hash and then iterates over that hash to get test names:

for test-name being each hash-key in (package-table package)

Common Lisp hyperspec clairifies that the order of evaluation in common lisp for looping over hashes is undefined (http://www.lispworks.com/documentation/HyperSpec/Body/06_abaf.htm).

It appears that (at least on my machine configuration / common lisp version), replacing the run-koans method in lisp-unit.lsp with the following ameliorates the issue in practice, but this solution is itself implementation-dependent, and a real solution would involve reworking how the lisp-unit.lsp package manages the list of tests to treat it as a list, not a hashtable.

(defun run-koans (package)
  "Run the list of test thunks in the package. Stopping                                                                                       
   at a failure or incomplete, with more helpful messaging"
  (let ((tests (loop
                  with results = nil
                  for test-name being each hash-key in (package-table package)
                  using (hash-value unit-test)
                  do (push `(,test-name . ,unit-test) results)
                    finally (return results))))
    (loop

    with koan-results = nil
    for (test-name . unit-test) in tests
    if unit-test do
      (push (list test-name (koan-result (code unit-test))) koan-results)
    else do
      (push (list test-name :missing) koan-results)
    until (and (not *proceed-after-failure*) (any-non-pass-p koan-results))
    finally (return koan-results))))

from lisp-koans.

acdart avatar acdart commented on May 4, 2024

Yes

from lisp-koans.

skovsgaard avatar skovsgaard commented on May 4, 2024

This happens on SBCL too, however not for all koans. It does happen in assert.lsp though.

from lisp-koans.

allenu avatar allenu commented on May 4, 2024

I'm hitting this as well with CLISP. It's frustrating writing solutions to each exercise in top-down order and then validating them in bottom-up order.

from lisp-koans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.