Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for folding anonymous subs

  • Loading branch information...
commit 4af4b3962b3436c0ff3829f6b2e51d835583ae01 1 parent 78bc844
@hoelzro hoelzro authored
Showing with 38 additions and 0 deletions.
  1. +38 −0 t/04_folding_anonymous_subs.t
View
38 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
Please sign in to comment.
Something went wrong with that request. Please try again.