2:2038aaa338fb
Anton Shestakov <av6@dwimlabs.net>, Thu, 08 Sep 2016 13:03:21 +0800
hglib: starting a new command server via Client.open()

next change 3:48f6ea626b5c
previous change 0:616025111516

spec/hglib_spec.lua

Permissions: -rw-r--r--

Other formats: Feeds:
local hglib = require('hglib')
describe('hglib client', function()
it('can connect using just file handles', function()
local rh = io.open('spec/data/hello', 'rb')
local client = hglib.Client.connect(rh, nil)
rh:close()
assert.is_true(client.capabilities.getencoding)
assert.is_true(client.capabilities.runcommand)
assert.are_equal('UTF-8', client.encoding)
assert.are_equal(3615, client.pid)
assert.are_equal(3615, client.pgid)
end)
it('can launch a new cmdserver process', function()
local client = hglib.Client.open()
assert.is_true(client.capabilities.getencoding)
assert.is_true(client.capabilities.runcommand)
assert.are_equal('UTF-8', client.encoding)
assert.are_equal('number', type(client.pid))
assert.are_equal('number', type(client.lpcpid))
client:close()
end)
end)