summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.py
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-27 17:17:42 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-27 17:17:42 +0100
commit5d7ead3bc85eefd0929bfcbb579510c8164ea1be (patch)
tree3663262f2410bd522e22f67355e7d351ccb67bc0 /src/testdir/test_channel.py
parent3ad8772ef02e4352b0fa4e2697abc357734b62e1 (diff)
downloadvim-git-5d7ead3bc85eefd0929bfcbb579510c8164ea1be.tar.gz
patch 8.0.1549: various small problems in test filesv8.0.1549
Problem: Various small problems in test files. Solution: Include small changes.
Diffstat (limited to 'src/testdir/test_channel.py')
-rw-r--r--src/testdir/test_channel.py66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py
index 6668752c4..bafa9dbf7 100644
--- a/src/testdir/test_channel.py
+++ b/src/testdir/test_channel.py
@@ -62,6 +62,39 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
if decoded[1] == 'hello!':
# simply send back a string
response = "got it"
+ elif decoded[1] == 'malformed1':
+ cmd = '["ex",":"]wrong!["ex","smi"]'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
+ # Need to wait for Vim to give up, otherwise it
+ # sometimes fails on OS X.
+ time.sleep(0.2)
+ elif decoded[1] == 'malformed2':
+ cmd = '"unterminated string'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
+ # Need to wait for Vim to give up, otherwise the double
+ # quote in the "ok" response terminates the string.
+ time.sleep(0.2)
+ elif decoded[1] == 'malformed3':
+ cmd = '["ex","missing ]"'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
+ # Need to wait for Vim to give up, otherwise the ]
+ # in the "ok" response terminates the list.
+ time.sleep(0.2)
+ elif decoded[1] == 'split':
+ cmd = '["ex","let '
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ time.sleep(0.01)
+ cmd = 'g:split = 123"]'
+ print("sending: {0}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
elif decoded[1].startswith("echo "):
# send back the argument
response = decoded[1][5:]
@@ -121,39 +154,6 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {0}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
- elif decoded[1] == 'malformed1':
- cmd = '["ex",":"]wrong!["ex","smi"]'
- print("sending: {0}".format(cmd))
- self.request.sendall(cmd.encode('utf-8'))
- response = "ok"
- # Need to wait for Vim to give up, otherwise it
- # sometimes fails on OS X.
- time.sleep(0.2)
- elif decoded[1] == 'malformed2':
- cmd = '"unterminated string'
- print("sending: {0}".format(cmd))
- self.request.sendall(cmd.encode('utf-8'))
- response = "ok"
- # Need to wait for Vim to give up, otherwise the double
- # quote in the "ok" response terminates the string.
- time.sleep(0.2)
- elif decoded[1] == 'malformed3':
- cmd = '["ex","missing ]"'
- print("sending: {0}".format(cmd))
- self.request.sendall(cmd.encode('utf-8'))
- response = "ok"
- # Need to wait for Vim to give up, otherwise the ]
- # in the "ok" response terminates the list.
- time.sleep(0.2)
- elif decoded[1] == 'split':
- cmd = '["ex","let '
- print("sending: {0}".format(cmd))
- self.request.sendall(cmd.encode('utf-8'))
- time.sleep(0.01)
- cmd = 'g:split = 123"]'
- print("sending: {0}".format(cmd))
- self.request.sendall(cmd.encode('utf-8'))
- response = "ok"
elif decoded[1] == 'an expr':
# Send an expr request.
cmd = '["expr","setline(\\"$\\", [\\"one\\",\\"two\\",\\"three\\"])"]'