Mercurial > vim
comparison src/testdir/test_channel.vim @ 7965:646d5148fee2 v7.4.1278
commit https://github.com/vim/vim/commit/55fab439a6f3bba6dbe780ac034b84d5822a1a96
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 16:53:13 2016 +0100
patch 7.4.1278
Problem: When jsonencode() fails it still returns something.
Solution: Return an empty string on failure.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 07 Feb 2016 17:00:05 +0100 |
parents | b74549818500 |
children | 5c30ba57aaea |
comparison
equal
deleted
inserted
replaced
7964:78b678f510f4 | 7965:646d5148fee2 |
---|---|
116 " Send an eval request that fails. | 116 " Send an eval request that fails. |
117 call assert_equal('ok', ch_sendexpr(handle, 'eval-fails')) | 117 call assert_equal('ok', ch_sendexpr(handle, 'eval-fails')) |
118 sleep 10m | 118 sleep 10m |
119 call assert_equal([-2, 'ERROR'], ch_sendexpr(handle, 'eval-result')) | 119 call assert_equal([-2, 'ERROR'], ch_sendexpr(handle, 'eval-result')) |
120 | 120 |
121 " Send an eval request that works but can't be encoded. | |
122 call assert_equal('ok', ch_sendexpr(handle, 'eval-error')) | |
123 sleep 10m | |
124 call assert_equal([-3, 'ERROR'], ch_sendexpr(handle, 'eval-result')) | |
125 | |
121 " Send a bad eval request. There will be no response. | 126 " Send a bad eval request. There will be no response. |
122 call assert_equal('ok', ch_sendexpr(handle, 'eval-bad')) | 127 call assert_equal('ok', ch_sendexpr(handle, 'eval-bad')) |
123 sleep 10m | 128 sleep 10m |
124 call assert_equal([-2, 'ERROR'], ch_sendexpr(handle, 'eval-result')) | 129 call assert_equal([-3, 'ERROR'], ch_sendexpr(handle, 'eval-result')) |
125 | 130 |
126 " Send an expr request | 131 " Send an expr request |
127 call assert_equal('ok', ch_sendexpr(handle, 'an expr')) | 132 call assert_equal('ok', ch_sendexpr(handle, 'an expr')) |
128 sleep 10m | 133 sleep 10m |
129 call assert_equal('one', getline(line('$') - 2)) | 134 call assert_equal('one', getline(line('$') - 2)) |