Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesg committed Nov 25, 2019
1 parent 591ffef commit 4b69a7c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Neovim/Ext/Plugin/Host.pm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ sub _unload
{
my $plugin = $this->_loaded->{$path};

foreach my $hook (@{$plugin->{module}->get_shutdown_hooks()})
foreach my $hook ($plugin->{module}->get_shutdown_hooks())
{
$hook->();
}
Expand Down
25 changes: 25 additions & 0 deletions t/10-rplugin_load.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!perl

use lib '.', 't/';
use File::Spec::Functions qw/rel2abs/;
use Test::More;
use TestNvim;
use Neovim::Ext;

my $tester = TestNvim->new;
my $vim = $tester->start();
my $host = Neovim::Ext::Plugin::Host->new ($vim);

is scalar (keys %{$host->request_handlers}), 3;
is scalar (keys %{$host->notification_handlers}), 1;

$host->_load (rel2abs ('t/rplugin/perl/TestPlugin.pm'));
is scalar (keys %{$host->request_handlers}), 4;
is scalar (keys %{$host->notification_handlers}), 2;

$host->_unload;
is scalar (keys %{$host->request_handlers}), 3;
is scalar (keys %{$host->notification_handlers}), 1;

done_testing();

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4b69a7c

Please sign in to comment.