Skip to content

Run test at point #5

@Ambrevar

Description

@Ambrevar

A feature I miss with Parachute (I haven't tried FiveAM) is the ability to easily run the single test I'm writing (or "the test at point"). Unless I'm missing something, the quickest way is to switch to a repl and run

(parachute:test 'my-package::my-test)

But if you do this a lot the back and forth switching quickly gets tiring...

Enters Slite with its convenient interface. Turns out that what I want fits in this very short function:

(defun slite-run-at-point (&optional raw-prefix-arg)
  "See `sly-compile-defun' for RAW-PREFIX-ARG."
  (interactive "P")
  (call-interactively 'sly-compile-defun)
  (slite-run
   (prin1-to-string
    `(parachute:test
      ,(let ((name (sly-parse-toplevel-form)))
         (if (symbolp name)
             `(quote ,(intern (sly-qualify-cl-symbol-name name)))
           name))))))

Now place the point on any test form and call slite-run-at-point.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions