summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndré A. Gomes <andremegafone@gmail.com>2022-12-06 15:42:32 +0200
committerAndré A. Gomes <andremegafone@gmail.com>2022-12-13 10:38:45 +0200
commit34f8cacb12a84e1436a644be620484ad7802fc52 (patch)
tree962de021f5bf73dbf8d743773c9561df4f4d0c27 /tests
parent8ca27760c6d74c8ee78ec2f2d6208f45e95e4d82 (diff)
gi-gtk/tests: Move with-prompt-buffer-test.
Avoids defining it in multiple files.
Diffstat (limited to 'tests')
-rw-r--r--tests/renderer-offline/set-url.lisp8
-rw-r--r--tests/renderer-online/set-url.lisp8
-rw-r--r--tests/renderer-package.lisp8
3 files changed, 8 insertions, 16 deletions
diff --git a/tests/renderer-offline/set-url.lisp b/tests/renderer-offline/set-url.lisp
index 4707ecec3..394ab4359 100644
--- a/tests/renderer-offline/set-url.lisp
+++ b/tests/renderer-offline/set-url.lisp
@@ -3,14 +3,6 @@
(in-package :nyxt/tests/renderer)
-(defmacro with-prompt-buffer-test (command &body body)
- (alexandria:with-gensyms (thread)
- `(let ((,thread (bt:make-thread (lambda () ,command))))
- (calispel:? (prompt-buffer-channel (current-window)))
- ,@body
- (return-selection)
- (bt:join-thread ,thread))))
-
;; TODO: Use `with-prompt-buffer-test'.
;; (with-prompt-buffer-test (set-url)
;; (update-prompt-input (current-prompt-buffer) "foobar"))
diff --git a/tests/renderer-online/set-url.lisp b/tests/renderer-online/set-url.lisp
index 839ed7c89..521e46e12 100644
--- a/tests/renderer-online/set-url.lisp
+++ b/tests/renderer-online/set-url.lisp
@@ -3,14 +3,6 @@
(in-package :nyxt/tests/renderer)
-(defmacro with-prompt-buffer-test (command &body body)
- (alexandria:with-gensyms (thread)
- `(let ((,thread (bt:make-thread (lambda () ,command))))
- (calispel:? (prompt-buffer-channel (current-window)))
- ,@body
- (return-selection)
- (bt:join-thread ,thread))))
-
;; TODO: Use `with-prompt-buffer-test'.
;; (with-prompt-buffer-test (set-url)
;; (update-prompt-input (current-prompt-buffer) "foobar"))
diff --git a/tests/renderer-package.lisp b/tests/renderer-package.lisp
index a2fc052e5..83a567e79 100644
--- a/tests/renderer-package.lisp
+++ b/tests/renderer-package.lisp
@@ -29,3 +29,11 @@
(setf nyxt::*headless-p* t)
,@body)
(setf nyxt::*headless-p* old-headless-p))))
+(defmacro with-prompt-buffer-test (command &body body)
+ (alexandria:with-gensyms (thread)
+ `(let ((,thread (bt:make-thread (lambda () ,command))))
+ (calispel:? (prompt-buffer-channel (current-window)))
+ ,@body
+ (return-selection)
+ (bt:join-thread ,thread))))
+