Permalink
Browse files

Add test for folding anonymous subs

  • Loading branch information...
1 parent 78bc844 commit 4af4b3962b3436c0ff3829f6b2e51d835583ae01 @hoelzro hoelzro committed Jan 20, 2013
Showing with 38 additions and 0 deletions.
  1. +38 −0 t/04_folding_anonymous_subs.t
@@ -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.