csys tests: use check-seq action (instead of tc:check-message)
This commit is contained in:
parent
ac4074eccc
commit
ef80927de4
2 changed files with 10 additions and 4 deletions
|
|
@ -15,7 +15,8 @@
|
|||
(:util :scopes/util)
|
||||
(:t :scopes/testing))
|
||||
(:export #:run #:user #:password
|
||||
#:test-receiver #:receiver #:expect #:check-message #:check-expected
|
||||
#:test-receiver #:receiver #:suite
|
||||
#:expect #:check-message #:check-expected
|
||||
#:setup #:test-suite)
|
||||
(:import-from :scopes/testing #:deftest #:== #:!=))
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,15 @@
|
|||
(defclass test-env (csys:environment)
|
||||
((test-suite :reader test-suite :initarg :test-suite)))
|
||||
|
||||
(defun check-seq (seq)
|
||||
(lambda (ctx msg)
|
||||
(let ((t:*test-suite* (tc:suite ctx)))
|
||||
(t:in-seq (shape:data msg) seq))))
|
||||
|
||||
(defun setup-config ()
|
||||
(config:add :test-receiver :setup #'tc:setup)
|
||||
(config:add-action '(:csys :sub) #'tc:check-message)
|
||||
(config:add-action '(:csys :sub) (check-seq '(4)))
|
||||
(config:add-action '(:csys :add) (check-seq '(1 3 5)))
|
||||
(config:add-action '(:csys) (constantly nil))
|
||||
)
|
||||
|
||||
|
|
@ -52,7 +58,7 @@
|
|||
(test-init rcvr))
|
||||
(sleep 0.1)
|
||||
(core:shutdown)
|
||||
(tc:check-expected)
|
||||
;(tc:check-expected)
|
||||
(t:show-result))))
|
||||
|
||||
(deftest test-init (rcvr)
|
||||
|
|
@ -64,7 +70,6 @@
|
|||
(sleep 0.1)
|
||||
(csys:send-message '(:csys :add :std :s1) 1)
|
||||
(csys:send-message '(:csys :add :std :s1) 3)
|
||||
(tc:expect rcvr (message:create '(:csys :sub :std :s2) :data 4))
|
||||
(csys:send-message '(:csys :sub :std :s2) 4)
|
||||
(csys:send-message '(:csys :add :std :s2) 5)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue