summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-10-30 12:36:04 +0400
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-10-30 12:36:04 +0400
commitef80c1f70453b6e52124a1f47b0aeef72e7a48c1 (patch)
tree07a4610261d06c1715544c35418c9ffbf1f57974 /tests
parentNEWS: Bump version to 0.10.1 (diff)
downloadguile-ssh-ef80c1f70453b6e52124a1f47b0aeef72e7a48c1.tar.gz
channel.scm (channel-send-eof!): New procedure
* modules/ssh/channel.scm (channel-send-eof!): New procedure. * libguile-ssh/channel-func.c (gssh_channel_send_eof_x): New procedure. * doc/api-channels.texi: Add description of 'channel-send-eof!'. * tests/client-server.scm ("channel-send-eof!"): New TC. * doc/version.texi, NEWS: Update.
Diffstat (limited to 'tests')
-rw-r--r--tests/client-server.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/client-server.scm b/tests/client-server.scm
index dac6aba..370f0d6 100644
--- a/tests/client-server.scm
+++ b/tests/client-server.scm
@@ -646,6 +646,32 @@
;;;
+;;; Channels
+;;;
+
+;; Client opens a channel to a server, sends data and then sends EOF on the
+;; channel. Server reads data and sends it back. Client checks if the
+;; channel is closed for output, and reads the data.
+(test-assert-with-log "channel-send-eof!"
+ (run-client-test
+ (lambda (server)
+ (start-server/dt-test server
+ (lambda (channel)
+ (let ((str (read-line channel)))
+ (write-line str channel)))))
+ (lambda ()
+ (call-with-connected-session/channel-test
+ (lambda (session)
+ (let ((channel (make-channel/dt-test session))
+ (str "Hello Scheme World!"))
+ (write-line str channel)
+ (channel-send-eof! channel)
+ (and (input-port? channel)
+ (not (output-port? channel))
+ (string=? (read-line channel) str))))))))
+
+
+;;;
(test-end "client-server")