Skip to content

Commit

Permalink
tests/tests: Add mark actions test.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Jan 8, 2024
1 parent 94e716c commit 6364d5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@
(assert-equal '("bar")
(calispel:? (prompter:result-channel prompter)))))))

(define-test mark-actions ()
(with-report-dangling-threads
(let* ((actions-on-marks-run-p nil)
(prompter (prompter:make
:sources (make-instance 'prompter:source
:name "Test source"
:enable-marks-p t
:actions-on-marks (lambda (marks)
(declare (ignore marks))
(setf actions-on-marks-run-p
t))
:constructor '("foo" "bar")))))
(when (prompter:all-ready-p prompter)
(setf (prompter:marks (first (prompter:sources prompter)))
(all-source-suggestions prompter))
(mapc #'join-thread* (all-live-prompter-threads))
(assert-true actions-on-marks-run-p)))))

(define-test multi-sources ()
(with-report-dangling-threads
(let ((prompter (prompter:make
Expand Down

0 comments on commit 6364d5c

Please sign in to comment.