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/provider/perl_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/provider/perl_spec.lua')
-rw-r--r-- | test/functional/provider/perl_spec.lua | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/test/functional/provider/perl_spec.lua b/test/functional/provider/perl_spec.lua index 8049f0f3e2..ae110cb3b0 100644 --- a/test/functional/provider/perl_spec.lua +++ b/test/functional/provider/perl_spec.lua @@ -14,7 +14,10 @@ do clear() local reason = missing_provider('perl') if reason then - pending(string.format("Missing perl host, or perl version is too old (%s)", reason), function() end) + pending( + string.format('Missing perl host, or perl version is too old (%s)', reason), + function() end + ) return end end @@ -30,7 +33,7 @@ describe('legacy perl provider', function() it(':perl command', function() command('perl $vim->vars->{set_by_perl} = [100, 0];') - eq({100, 0}, eval('g:set_by_perl')) + eq({ 100, 0 }, eval('g:set_by_perl')) end) it(':perlfile command', function() @@ -61,19 +64,21 @@ describe('legacy perl provider', function() end) it('perleval()', function() - eq({1, 2, {['key'] = 'val'}}, eval([[perleval('[1, 2, {"key" => "val"}]')]])) + eq({ 1, 2, { ['key'] = 'val' } }, eval([[perleval('[1, 2, {"key" => "val"}]')]])) end) end) describe('perl provider', function() - teardown(function () + teardown(function() os.remove('Xtest-perl-hello.pl') os.remove('Xtest-perl-hello-plugin.pl') end) it('works', function() local fname = 'Xtest-perl-hello.pl' - write_file(fname, [[ + write_file( + fname, + [[ package main; use strict; use warnings; @@ -84,14 +89,19 @@ describe('perl provider', function() my $nvim = Neovim::Ext::from_session($session); $nvim->command('let g:job_out = "hello"'); 1; - ]]) - command('let g:job_id = jobstart(["perl", "'..fname..'"])') - retry(nil, 3000, function() eq('hello', eval('g:job_out')) end) + ]] + ) + command('let g:job_id = jobstart(["perl", "' .. fname .. '"])') + retry(nil, 3000, function() + eq('hello', eval('g:job_out')) + end) end) it('plugin works', function() local fname = 'Xtest-perl-hello-plugin.pl' - write_file(fname, [[ + write_file( + fname, + [[ package TestPlugin; use strict; use warnings; @@ -118,8 +128,11 @@ describe('perl provider', function() my $plugin = TestPlugin->new($nvim); $plugin->test_command(); 1; - ]]) - command('let g:job_id = jobstart(["perl", "'..fname..'"])') - retry(nil, 3000, function() eq('hello-plugin', eval('g:job_out')) end) + ]] + ) + command('let g:job_id = jobstart(["perl", "' .. fname .. '"])') + retry(nil, 3000, function() + eq('hello-plugin', eval('g:job_out')) + end) end) end) |