comparison src/testdir/test_channel.py @ 8744:ff9973bbbfcb v7.4.1661

commit https://github.com/vim/vim/commit/fa8b2e173dd5f6c4a5cfd326abdcf68b8eebf90d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 26 22:19:27 2016 +0100 patch 7.4.1661 Problem: No test for special characters in channel eval command. Solution: Testing sending and receiving text with special characters.
author Christian Brabandt <cb@256bit.org>
date Sat, 26 Mar 2016 22:30:04 +0100
parents b2a48aabe21f
children 4c38a4733578
comparison
equal deleted inserted replaced
8743:42940780f146 8744:ff9973bbbfcb
83 # Send an eval request. We ignore the response. 83 # Send an eval request. We ignore the response.
84 cmd = '["expr","\\"foo\\" . 123", -1]' 84 cmd = '["expr","\\"foo\\" . 123", -1]'
85 print("sending: {0}".format(cmd)) 85 print("sending: {0}".format(cmd))
86 self.request.sendall(cmd.encode('utf-8')) 86 self.request.sendall(cmd.encode('utf-8'))
87 response = "ok" 87 response = "ok"
88 elif decoded[1] == 'eval-special':
89 # Send an eval request. We ignore the response.
90 cmd = '["expr","\\"foo\x7f\x10\x01bar\\"", -2]'
91 print("sending: {0}".format(cmd))
92 self.request.sendall(cmd.encode('utf-8'))
93 response = "ok"
94 elif decoded[1] == 'eval-getline':
95 # Send an eval request. We ignore the response.
96 cmd = '["expr","getline(3)", -3]'
97 print("sending: {0}".format(cmd))
98 self.request.sendall(cmd.encode('utf-8'))
99 response = "ok"
88 elif decoded[1] == 'eval-fails': 100 elif decoded[1] == 'eval-fails':
89 # Send an eval request that will fail. 101 # Send an eval request that will fail.
90 cmd = '["expr","xxx", -2]' 102 cmd = '["expr","xxx", -4]'
91 print("sending: {0}".format(cmd)) 103 print("sending: {0}".format(cmd))
92 self.request.sendall(cmd.encode('utf-8')) 104 self.request.sendall(cmd.encode('utf-8'))
93 response = "ok" 105 response = "ok"
94 elif decoded[1] == 'eval-error': 106 elif decoded[1] == 'eval-error':
95 # Send an eval request that works but the result can't 107 # Send an eval request that works but the result can't
96 # be encoded. 108 # be encoded.
97 cmd = '["expr","function(\\"tr\\")", -3]' 109 cmd = '["expr","function(\\"tr\\")", -5]'
98 print("sending: {0}".format(cmd)) 110 print("sending: {0}".format(cmd))
99 self.request.sendall(cmd.encode('utf-8')) 111 self.request.sendall(cmd.encode('utf-8'))
100 response = "ok" 112 response = "ok"
101 elif decoded[1] == 'eval-bad': 113 elif decoded[1] == 'eval-bad':
102 # Send an eval request missing the third argument. 114 # Send an eval request missing the third argument.