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