test/win: fix some environment assumptions #7912

fix #7909
fix #7910
This commit is contained in:
George Zhao
2018-01-24 18:01:14 +08:00
committed by Justin M. Keyes
parent 16a6f44570
commit 499c9a1553
3 changed files with 12 additions and 2 deletions

View File

@@ -1,7 +1,9 @@
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
local ok = helpers.ok
local call = helpers.call
local clear = helpers.clear
local iswin = helpers.iswin
describe('hostname()', function()
before_each(clear)
@@ -11,7 +13,8 @@ describe('hostname()', function()
ok(string.len(actual) > 0)
if call('executable', 'hostname') == 1 then
local expected = string.gsub(call('system', 'hostname'), '[\n\r]', '')
helpers.eq(expected, actual)
eq((iswin() and expected:upper() or expected),
(iswin() and actual:upper() or actual))
end
end)
end)