diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-01-03 02:09:18 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-01-03 02:09:29 +0100 |
commit | 04f2f864e270e772c6326cefdf24947f0130e492 (patch) | |
tree | 46f83f909b888a66c741032ab955afc6eab84292 /test/functional/lua/system_spec.lua | |
parent | 59d117ec99b6037cb9fad5bbfb6d0b18f5012927 (diff) | |
download | rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.gz rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.bz2 rneovim-04f2f864e270e772c6326cefdf24947f0130e492.zip |
refactor: format test/*
Diffstat (limited to 'test/functional/lua/system_spec.lua')
-rw-r--r-- | test/functional/lua/system_spec.lua | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/test/functional/lua/system_spec.lua b/test/functional/lua/system_spec.lua index a988d3f0d7..bae8322b43 100644 --- a/test/functional/lua/system_spec.lua +++ b/test/functional/lua/system_spec.lua @@ -4,7 +4,8 @@ local exec_lua = helpers.exec_lua local eq = helpers.eq local function system_sync(cmd, opts) - return exec_lua([[ + return exec_lua( + [[ local cmd, opts = ... local obj = vim.system(...) @@ -21,11 +22,15 @@ local function system_sync(cmd, opts) assert(not proc, 'process still exists') return res - ]], cmd, opts) + ]], + cmd, + opts + ) end local function system_async(cmd, opts) - return exec_lua([[ + return exec_lua( + [[ local cmd, opts = ... _G.done = false local obj = vim.system(cmd, opts, function(obj) @@ -44,7 +49,10 @@ local function system_async(cmd, opts) assert(not proc, 'process still exists') return _G.ret - ]], cmd, opts) + ]], + cmd, + opts + ) end describe('vim.system', function() @@ -52,10 +60,10 @@ describe('vim.system', function() clear() end) - for name, system in pairs{ sync = system_sync, async = system_async, } do - describe('('..name..')', function() + for name, system in pairs { sync = system_sync, async = system_async } do + describe('(' .. name .. ')', function() it('can run simple commands', function() - eq('hello\n', system({'echo', 'hello' }, { text = true }).stdout) + eq('hello\n', system({ 'echo', 'hello' }, { text = true }).stdout) end) it('handle input', function() @@ -67,7 +75,7 @@ describe('vim.system', function() code = 124, signal = 15, stdout = '', - stderr = '' + stderr = '', }, system({ 'sleep', '10' }, { timeout = 1000 })) end) end) @@ -96,5 +104,4 @@ describe('vim.system', function() assert(signal == 2) ]]) end) - end) |