test/channels_spec: cleanup

- Remove stray print()
- Use uname() instead of system('uname')
This commit is contained in:
Justin M. Keyes 2018-11-21 06:02:24 +01:00
parent ab7d9ae193
commit 24f9dd73d5
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,5 @@
local global_helpers = require('test.helpers')
local uname = global_helpers.uname
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, eval, next_msg, ok, source = helpers.clear, helpers.eq,
@ -7,6 +9,7 @@ local sleep = helpers.sleep
local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv
local set_session = helpers.set_session
local nvim_prog = helpers.nvim_prog
local os_name = helpers.os_name
local retry = helpers.retry
local expect_twostreams = helpers.expect_twostreams
@ -138,9 +141,8 @@ describe('channels', function()
command("call chansend(id, 'incomplet\004')")
local is_freebsd = eval("system('uname') =~? 'FreeBSD'") == 1
local bsdlike = is_freebsd or (helpers.os_name() == "osx")
print("bsdlike:", bsdlike)
local is_freebsd = (string.lower(uname()) == 'freebsd')
local bsdlike = is_freebsd or (os_name() == "osx")
local extra = bsdlike and "^D\008\008" or ""
expect_twoline(id, "stdout",
"incomplet"..extra, "[1, ['incomplet'], 'stdin']", true)

View File

@ -6,7 +6,7 @@ local clear, curbufmeths = helpers.clear, helpers.curbufmeths
local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval
local insert = helpers.insert
describe('api functions', function()
describe('eval-API', function()
before_each(clear)
it("work", function()