90b2a4
From 4ba21b30b81c9f775932674d4c29f1b81e15bfa2 Mon Sep 17 00:00:00 2001
90b2a4
From: Jitka Plesnikova <jplesnik@redhat.com>
90b2a4
Date: Tue, 21 Apr 2020 09:01:47 +0200
90b2a4
Subject: [PATCH] Upgrade to 0.96
90b2a4
90b2a4
---
90b2a4
 lib/Filter/Simple.pm                 |  3 ++-
90b2a4
 t/filter_only.t                      | 19 ++++++++++++++++++-
90b2a4
 t/lib/Filter/Simple/ExeNoComments.pm | 11 +++++++++++
90b2a4
 3 files changed, 31 insertions(+), 2 deletions(-)
90b2a4
 create mode 100644 t/lib/Filter/Simple/ExeNoComments.pm
90b2a4
90b2a4
diff --git a/lib/Filter/Simple.pm b/lib/Filter/Simple.pm
90b2a4
index 1dcf3c8..924c2ae 100644
90b2a4
--- a/lib/Filter/Simple.pm
90b2a4
+++ b/lib/Filter/Simple.pm
90b2a4
@@ -2,7 +2,7 @@ package Filter::Simple;
90b2a4
 
90b2a4
 use Text::Balanced ':ALL';
90b2a4
 
90b2a4
-our $VERSION = '0.95';
90b2a4
+our $VERSION = '0.96';
90b2a4
 
90b2a4
 use Filter::Util::Call;
90b2a4
 use Carp;
90b2a4
@@ -70,6 +70,7 @@ my %extractor_for = (
90b2a4
 my %selector_for = (
90b2a4
     all   => sub { my ($t)=@_; sub{ $_=$$_; $t->(@_); $_} },
90b2a4
     executable=> sub { my ($t)=@_; sub{ref() ? $_=$$_ : $t->(@_); $_} }, 
90b2a4
+    executable_no_comments=> sub { my ($t)=@_; sub{ref() ? $_=$$_ : $t->(@_); $_} },
90b2a4
     quotelike => sub { my ($t)=@_; sub{ref() && do{$_=$$_; $t->(@_)}; $_} },
90b2a4
     regex     => sub { my ($t)=@_;
90b2a4
                sub{ref() or return $_;
90b2a4
diff --git a/t/filter_only.t b/t/filter_only.t
90b2a4
index 57f1086..cd86707 100644
90b2a4
--- a/t/filter_only.t
90b2a4
+++ b/t/filter_only.t
90b2a4
@@ -4,7 +4,7 @@ BEGIN {
90b2a4
 
90b2a4
 use Filter::Simple::FilterOnlyTest qr/not ok/ => "ok", 
90b2a4
                                    "bad" => "ok", fail => "die";
90b2a4
-print "1..9\n";
90b2a4
+print "1..11\n";
90b2a4
 
90b2a4
 sub fail { print "ok ", $_[0], "\n" }
90b2a4
 sub ok { print "ok ", $_[0], "\n" }
90b2a4
@@ -41,3 +41,20 @@ print "ok 8\n";
90b2a4
 
90b2a4
 print "not " unless "bad" =~ /bad/;
90b2a4
 print "ok 9\n";
90b2a4
+
90b2a4
+use Filter::Simple::ExeNoComments;
90b2a4
+
90b2a4
+=for us
90b2a4
+
90b2a4
+shromplex
90b2a4
+
90b2a4
+=cut
90b2a4
+
90b2a4
+# shromplex
90b2a4
+
90b2a4
+# test the difference from code*
90b2a4
+my $x = "ABC";
90b2a4
+
90b2a4
+print $x eq "TEST" ? "" : "not ", "ok 10 # check strings processed\n";
90b2a4
+
90b2a4
+print "ok 11 # executable_no_comments\n";
90b2a4
diff --git a/t/lib/Filter/Simple/ExeNoComments.pm b/t/lib/Filter/Simple/ExeNoComments.pm
90b2a4
new file mode 100644
90b2a4
index 0000000..3eaa454
90b2a4
--- /dev/null
90b2a4
+++ b/t/lib/Filter/Simple/ExeNoComments.pm
90b2a4
@@ -0,0 +1,11 @@
90b2a4
+package Filter::Simple::ExeNoComments;
90b2a4
+
90b2a4
+use Filter::Simple;
90b2a4
+
90b2a4
+FILTER_ONLY
90b2a4
+  executable_no_comments => sub {
90b2a4
+            $_ =~ /shromplex/ and die "We wants no shromplexes!";
90b2a4
+            s/ABC/TEST/g;
90b2a4
+	};
90b2a4
+
90b2a4
+1;
90b2a4
-- 
90b2a4
2.21.1
90b2a4