diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-02-07 16:53:13 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-02-07 16:53:13 +0100 |
commit | 55fab439a6f3bba6dbe780ac034b84d5822a1a96 (patch) | |
tree | 9ba61a5c778725b73c3f687bcdbd730b89067cbb /src/testdir/test_channel.py | |
parent | a6f72ba7c6cadd37be38d92008d10a3025fdc5ec (diff) | |
download | vim-55fab439a6f3bba6dbe780ac034b84d5822a1a96.zip |
patch 7.4.1278
Problem: When jsonencode() fails it still returns something.
Solution: Return an empty string on failure.
Diffstat (limited to 'src/testdir/test_channel.py')
-rw-r--r-- | src/testdir/test_channel.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py index d8830c519..40a2043cc 100644 --- a/src/testdir/test_channel.py +++ b/src/testdir/test_channel.py @@ -93,6 +93,13 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): print("sending: {}".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 = '["eval","function(\\"tr\\")", -3]' + print("sending: {}".format(cmd)) + self.request.sendall(cmd.encode('utf-8')) + response = "ok" elif decoded[1] == 'eval-bad': # Send an eval request missing the third argument. cmd = '["eval","xxx"]' |