~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to test/functional/api/server_requests_spec.lua

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-02-20 22:41:32 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: package-import@ubuntu.com-20160220224132-e24n8lh3yo5ylt23
Tags: upstream-0.1.2
ImportĀ upstreamĀ versionĀ 0.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    end)
33
33
  end)
34
34
 
 
35
  describe('empty string handling in arrays', function()
 
36
    -- Because the msgpack encoding for an empty string was interpreted as an
 
37
    -- error, msgpack arrays with an empty string looked like
 
38
    -- [..., '', 0, ..., 0] after the conversion, regardless of the array
 
39
    -- elements following the empty string.
 
40
    it('works', function()
 
41
      local function on_setup()
 
42
        eq({1, 2, '', 3, 'asdf'}, eval('rpcrequest('..cid..', "nstring")'))
 
43
        stop()
 
44
      end
 
45
 
 
46
      local function on_request()
 
47
        -- No need to evaluate the args, we are only interested in
 
48
        -- a response that contains an array with an empty string.
 
49
        return {1, 2, '', 3, 'asdf'}
 
50
      end
 
51
      run(on_request, nil, on_setup)
 
52
    end)
 
53
  end)
 
54
 
35
55
  describe('recursive call', function()
36
56
    it('works', function()
37
57
      local function on_setup()