diff options
Diffstat (limited to 'src/testdir/test_perl.vim')
-rw-r--r-- | src/testdir/test_perl.vim | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/testdir/test_perl.vim b/src/testdir/test_perl.vim index 661c65cdc8..03c5fa0d10 100644 --- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -4,6 +4,9 @@ if !has('perl') finish end +" FIXME: RunTest don't see any error when Perl abort... +perl $SIG{__WARN__} = sub { die "Unexpected warnings from perl: @_" }; + func Test_change_buffer() call setline(line('$'), ['1 line 1']) perl VIM::DoCommand("normal /^1\n") @@ -229,6 +232,15 @@ func Test_000_SvREFCNT() #line 5 "Test_000_SvREFCNT()" my ($b, $w); + my $num = 0; + for ( 0 .. 100 ) { + if ( ++$num >= 8 ) { $num = 0 } + VIM::DoCommand("buffer X$num"); + $b = $curbuf; + } + + VIM::DoCommand("buffer t"); + $b = $curbuf for 0 .. 100; $w = $curwin for 0 .. 100; () = VIM::Buffers for 0 .. 100; @@ -240,12 +252,13 @@ func Test_000_SvREFCNT() my $cw = Internals::SvREFCNT($$w); VIM::Eval("assert_equal(2, $cb, 'T1')"); VIM::Eval("assert_equal(2, $cw, 'T2')"); + my $strongref; foreach ( VIM::Buffers, VIM::Windows ) { + VIM::DoCommand("%bw!"); my $c = Internals::SvREFCNT($_); VIM::Eval("assert_equal(2, $c, 'T3')"); $c = Internals::SvREFCNT($$_); - # Why only one ref? - # Look wrong but work. Maybe not portable... + next if $c == 2 && !$strongref++; VIM::Eval("assert_equal(1, $c, 'T4')"); } $cb = Internals::SvREFCNT($$curbuf); |