Giter Club home page Giter Club logo

Comments (7)

swsnr avatar swsnr commented on August 10, 2024

Hello please add the code of the failing test to your comment. Thanks.

from ert-runner.el.

nlamirault avatar nlamirault commented on August 10, 2024

Here the code of the unit test 1 :

(ert-deftest test-dionysos-process-can-start-process ()
  :tags '(process current)
  (with-test-sandbox
   (with-music-file
    "resources/Roulement_tambour-01.mp3"
    (dionysos--create-process
     dionysos--process-name "mpg123" (list file) (lambda () (message "ok")))
    (should (equal 'run (dionysos--status-process dionysos--process-name)))
    (dionysos--kill-process dionysos--process-name)
    (should (equal nil (process-list))))))

And the process code 2:

(defun dionysos--create-process (process-name command arguments &optional hook)
  "Create a new asynchronous process.
`PROCESS-NAME' is used to identify this process
`COMMAND' correspond to the program running
`ARGUMENTS' are arguments passed to the program.
`HOOK' is called when process is finished."
  (message "[dionysos-process] Create %s %s %s %s"
           process-name command arguments hook)
  (let ((status (dionysos--status-process process-name)))
    (message "[dionysos-process] Status : %s" status)
    (unless (equal 'run status)
      (lexical-let ((hook hook))
        (let ((process (apply 'start-process process-name nil command arguments)))
          (set-process-sentinel
           process
           (lambda (process event)
             (dionysos--process-sentinel process event hook))))))))

from ert-runner.el.

swsnr avatar swsnr commented on August 10, 2024

Do you actually require cl or cl-lib in your code?

from ert-runner.el.

swsnr avatar swsnr commented on August 10, 2024

Besides I'd recommend you to use lexical binding over lexical-let. At least use cl-lib and cl-lexical-let.

from ert-runner.el.

nlamirault avatar nlamirault commented on August 10, 2024

in dionysos.el file, there is :

(require 'cl-lib)

and in dionysos-process.el file also.

from ert-runner.el.

swsnr avatar swsnr commented on August 10, 2024

@nlamirault lexical-let is in cl, not cl-lib. Actually, I'm not sure whether cl-lexical-let actually exists; I don't think it was ported to cl-lib given that Emacs now has proper lexical binding.

In any case it looks like you're missing a require, which means that Emacs doesn't know that lexical-let is a macro and thus tries to evaluate (hook hook) as a function call.

Try whether (require 'cl) fixes the issue.

from ert-runner.el.

nlamirault avatar nlamirault commented on August 10, 2024

Thanks ! it works now.

from ert-runner.el.

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.