Skip to content

Commit

Permalink
Add test for folding anonymous subs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Jan 20, 2013
1 parent 78bc844 commit 4af4b39
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions t/04_folding_anonymous_subs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
use strict;
use warnings;
use lib 't';

use Test::More tests => 2;
use VimFolds;

my $no_anon_folds = VimFolds->new(
language => 'perl',
script_before => 'let perl_fold=1 | let perl_nofold_packages=1'
);

my $anon_folds = VimFolds->new(
language => 'perl',
script_before => 'let perl_fold=1 | let perl_nofold_packages=1 | let perl_fold_anonymous_subs=1'
);

$no_anon_folds->folds_match(<<'END_PERL');
use strict;
use warnings;
my $anon_sub = sub {
print "one\n";
print "two\n";
print "three\n";
};
END_PERL

$anon_folds->folds_match(<<'END_PERL');
use strict;
use warnings;
my $anon_sub = sub { # {{{
print "one\n";
print "two\n";
print "three\n";
}; # }}}
END_PERL

0 comments on commit 4af4b39

Please sign in to comment.