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