--- a/hglib.lua Thu Sep 08 13:03:21 2016 +0800
+++ b/hglib.lua Thu Sep 08 13:05:13 2016 +0800
+function Client:getencoding()
+ if not self.capabilities.getencoding then
+ return nil, 'getencoding is not supported by this command server'
+ self.wh:write('getencoding\n')
+ local channel, message = read_channel(self.rh)
+ elseif channel == 'e' then
--- a/spec/hglib_spec.lua Thu Sep 08 13:03:21 2016 +0800
+++ b/spec/hglib_spec.lua Thu Sep 08 13:05:13 2016 +0800
assert.are_equal('number', type(client.lpcpid))
+ it('can send getencoding command', function()
+ local client = hglib.Client.open()
+ local encoding, err = client:getencoding()
+ assert.are_equal('string', type(encoding))