File: stdio_fixture.lua

package info (click to toggle)
lua-nvim 0.2.4-1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 168 kB
  • sloc: makefile: 67; ansic: 32
file content (17 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- stdio test fixture / program.
--
-- Lua's paths are passed as arguments to reflect the path in the test itself.
package.path = arg[1]
package.cpath = arg[2]
local assert = require("luassert")

local StdioStream = require('nvim.stdio_stream')
local Session = require('nvim.session')

local stdio_stream = StdioStream.open()
local session = Session.new(stdio_stream)

assert.are.same({'notification', 'a', {0, 1}}, session:next_message())
session:notify('b', 2, 3)
assert.are.same({'notification', 'c', {4, 5}}, session:next_message())
session:notify('d', 6, 7)