summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.py
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-26 17:58:53 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-26 17:58:53 +0200
commitf1f0792e55e72cdc7c833b30f565a9b02f18bb1e (patch)
tree0c63bd3971cde94874394587ca3bede776f87abf /src/testdir/test_channel.py
parent9f28953f0c1e3d9fffd49af76503f54eaa279acb (diff)
downloadvim-f1f0792e55e72cdc7c833b30f565a9b02f18bb1e.zip
patch 7.4.2258
Problem: Two JSON messages are sent without a separator. Solution: Separate messages with a NL. (closes #1001)
Diffstat (limited to 'src/testdir/test_channel.py')
-rw-r--r--src/testdir/test_channel.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py
index b5a912c07..07a22418a 100644
--- a/src/testdir/test_channel.py
+++ b/src/testdir/test_channel.py
@@ -38,15 +38,15 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("received: {0}".format(received))
# We may receive two messages at once. Take the part up to the
- # matching "]" (recognized by finding "][").
+ # newline, which should be after the matching "]".
todo = received
while todo != '':
- splitidx = todo.find('][')
+ splitidx = todo.find('\n')
if splitidx < 0:
used = todo
todo = ''
else:
- used = todo[:splitidx + 1]
+ used = todo[:splitidx]
todo = todo[splitidx + 1:]
if used != received:
print("using: {0}".format(used))