From 5d7ead3bc85eefd0929bfcbb579510c8164ea1be Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 27 Feb 2018 17:17:42 +0100 Subject: patch 8.0.1549: various small problems in test files Problem: Various small problems in test files. Solution: Include small changes. --- src/testdir/test_channel.py | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/testdir/test_channel.py') diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py index 6668752c42..bafa9dbf76 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\\"])"]' -- cgit v1.2.3