test: handle single-char hostname (#6939)

This commit is contained in:
KunMing Xie
2017-07-02 00:48:17 +08:00
committed by Justin M. Keyes
parent fcbc7a8db4
commit 57d691e81a

View File

@@ -8,7 +8,7 @@ describe('hostname()', function()
it('returns hostname string', function()
local actual = call('hostname')
ok(string.len(actual) > 1)
ok(string.len(actual) > 0)
if call('executable', 'hostname') == 1 then
local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '')
helpers.eq(expected, actual)