summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel.py
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-26 22:19:27 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-26 22:19:27 +0100
commitfa8b2e173dd5f6c4a5cfd326abdcf68b8eebf90d (patch)
tree7ac6a0655d1acfcb4061b6c7f81d07e6b9b68cf1 /src/testdir/test_channel.py
parent819821c5a95fc60797ecbb5e5ca1302e397e3d9a (diff)
patch 7.4.1661v7.4.1661
Problem: No test for special characters in channel eval command. Solution: Testing sending and receiving text with special characters.
Diffstat (limited to 'src/testdir/test_channel.py')
-rw-r--r--src/testdir/test_channel.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py
index 61e76ec4f8..227780a5eb 100644
--- a/src/testdir/test_channel.py
+++ b/src/testdir/test_channel.py
@@ -85,16 +85,28 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {0}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
+ elif decoded[1] == 'eval-special':
+ # Send an eval request. We ignore the response.
+ cmd = '["expr","\\"foo\x7f\x10\x01bar\\"", -2]'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
+ elif decoded[1] == 'eval-getline':
+ # Send an eval request. We ignore the response.
+ cmd = '["expr","getline(3)", -3]'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
elif decoded[1] == 'eval-fails':
# Send an eval request that will fail.
- cmd = '["expr","xxx", -2]'
+ cmd = '["expr","xxx", -4]'
print("sending: {0}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
elif decoded[1] == 'eval-error':
# Send an eval request that works but the result can't
# be encoded.
- cmd = '["expr","function(\\"tr\\")", -3]'
+ cmd = '["expr","function(\\"tr\\")", -5]'
print("sending: {0}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"