comparison src/testdir/test_channel.py @ 13351:33a2277b8d4d v8.0.1549

patch 8.0.1549: various small problems in test files commit https://github.com/vim/vim/commit/5d7ead3bc85eefd0929bfcbb579510c8164ea1be Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 27 17:17:42 2018 +0100 patch 8.0.1549: various small problems in test files Problem: Various small problems in test files. Solution: Include small changes.
author Christian Brabandt <cb@256bit.org>
date Tue, 27 Feb 2018 17:30:07 +0100
parents a57b2284de93
children e373843e2980
comparison
equal deleted inserted replaced
13350:73e42c11db9e 13351:33a2277b8d4d
60 # Send a response if the sequence number is positive. 60 # Send a response if the sequence number is positive.
61 if decoded[0] >= 0: 61 if decoded[0] >= 0:
62 if decoded[1] == 'hello!': 62 if decoded[1] == 'hello!':
63 # simply send back a string 63 # simply send back a string
64 response = "got it" 64 response = "got it"
65 elif decoded[1] == 'malformed1':
66 cmd = '["ex",":"]wrong!["ex","smi"]'
67 print("sending: {0}".format(cmd))
68 self.request.sendall(cmd.encode('utf-8'))
69 response = "ok"
70 # Need to wait for Vim to give up, otherwise it
71 # sometimes fails on OS X.
72 time.sleep(0.2)
73 elif decoded[1] == 'malformed2':
74 cmd = '"unterminated string'
75 print("sending: {0}".format(cmd))
76 self.request.sendall(cmd.encode('utf-8'))
77 response = "ok"
78 # Need to wait for Vim to give up, otherwise the double
79 # quote in the "ok" response terminates the string.
80 time.sleep(0.2)
81 elif decoded[1] == 'malformed3':
82 cmd = '["ex","missing ]"'
83 print("sending: {0}".format(cmd))
84 self.request.sendall(cmd.encode('utf-8'))
85 response = "ok"
86 # Need to wait for Vim to give up, otherwise the ]
87 # in the "ok" response terminates the list.
88 time.sleep(0.2)
89 elif decoded[1] == 'split':
90 cmd = '["ex","let '
91 print("sending: {0}".format(cmd))
92 self.request.sendall(cmd.encode('utf-8'))
93 time.sleep(0.01)
94 cmd = 'g:split = 123"]'
95 print("sending: {0}".format(cmd))
96 self.request.sendall(cmd.encode('utf-8'))
97 response = "ok"
65 elif decoded[1].startswith("echo "): 98 elif decoded[1].startswith("echo "):
66 # send back the argument 99 # send back the argument
67 response = decoded[1][5:] 100 response = decoded[1][5:]
68 elif decoded[1] == 'make change': 101 elif decoded[1] == 'make change':
69 # Send two ex commands at the same time, before 102 # Send two ex commands at the same time, before
116 self.request.sendall(cmd.encode('utf-8')) 149 self.request.sendall(cmd.encode('utf-8'))
117 response = "ok" 150 response = "ok"
118 elif decoded[1] == 'eval-bad': 151 elif decoded[1] == 'eval-bad':
119 # Send an eval request missing the third argument. 152 # Send an eval request missing the third argument.
120 cmd = '["expr","xxx"]' 153 cmd = '["expr","xxx"]'
121 print("sending: {0}".format(cmd))
122 self.request.sendall(cmd.encode('utf-8'))
123 response = "ok"
124 elif decoded[1] == 'malformed1':
125 cmd = '["ex",":"]wrong!["ex","smi"]'
126 print("sending: {0}".format(cmd))
127 self.request.sendall(cmd.encode('utf-8'))
128 response = "ok"
129 # Need to wait for Vim to give up, otherwise it
130 # sometimes fails on OS X.
131 time.sleep(0.2)
132 elif decoded[1] == 'malformed2':
133 cmd = '"unterminated string'
134 print("sending: {0}".format(cmd))
135 self.request.sendall(cmd.encode('utf-8'))
136 response = "ok"
137 # Need to wait for Vim to give up, otherwise the double
138 # quote in the "ok" response terminates the string.
139 time.sleep(0.2)
140 elif decoded[1] == 'malformed3':
141 cmd = '["ex","missing ]"'
142 print("sending: {0}".format(cmd))
143 self.request.sendall(cmd.encode('utf-8'))
144 response = "ok"
145 # Need to wait for Vim to give up, otherwise the ]
146 # in the "ok" response terminates the list.
147 time.sleep(0.2)
148 elif decoded[1] == 'split':
149 cmd = '["ex","let '
150 print("sending: {0}".format(cmd))
151 self.request.sendall(cmd.encode('utf-8'))
152 time.sleep(0.01)
153 cmd = 'g:split = 123"]'
154 print("sending: {0}".format(cmd)) 154 print("sending: {0}".format(cmd))
155 self.request.sendall(cmd.encode('utf-8')) 155 self.request.sendall(cmd.encode('utf-8'))
156 response = "ok" 156 response = "ok"
157 elif decoded[1] == 'an expr': 157 elif decoded[1] == 'an expr':
158 # Send an expr request. 158 # Send an expr request.