Skip to content

Commit

Permalink
Add nonblocking socket integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
abcdw committed May 1, 2024
1 parent 29bf682 commit 902c3e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ server:

ares-rs: server

fine-socket:
${GUILE} -L ./src -L ./tests -c \
"(pk ((@ (nonblocking-socket) create-socket)))"

check:
${GUILE} -L ./src -L ./tests \
-c "((@ (ares srfi-64 test-runners) run-project-tests))"
Expand Down
13 changes: 13 additions & 0 deletions tests/integration-test.scm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@
"6"
(assoc-ref (receive-message) "value"))))

(send-message
`(("code" . "((@ (nonblocking-socket) create-socket-exception))")
("session" . ,session-id)
("op" . "eval")))

(test-group "nonblocking socket"
;; https://todo.sr.ht/~abcdw/tickets/7
;; Should return connection refused (system-error)
(test-expect-fail 1)
(test-equal "create socket"
"system-error"
(assoc-ref (receive-message) "value")))

;; (test-group "read error"
;; (test-group "arithmetics"
;; (test-equal "code for evaluation: (+ 1 2 3"
Expand Down

0 comments on commit 902c3e6

Please sign in to comment.