summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm')
-rwxr-xr-xMaster/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm47
1 files changed, 47 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm b/Master/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm
new file mode 100755
index 00000000000..08fc6b5971f
--- /dev/null
+++ b/Master/tlpkg/tlperl/lib/Test/Deep/RegexpOnly.pm
@@ -0,0 +1,47 @@
+use strict;
+use warnings;
+
+package Test::Deep::Regexp;
+
+use Test::Deep::Cmp;
+
+use Scalar::Util qw( blessed );
+
+sub init
+{
+ my $self = shift;
+
+ my $val = shift;
+
+ $val = ref $val ? $val : qr/$val/;
+
+ $self->{val} = $val;
+}
+
+sub descend
+{
+ my $self = shift;
+ my $got = shift;
+
+ my $re = $self->{val};
+
+ return ($got =~ $self->{val} ? 1 : 0;
+}
+
+sub diag_message
+{
+ my $self = shift;
+
+ my $where = shift;
+
+ return "Using Regexp on $where";
+}
+
+sub renderExp
+{
+ my $self = shift;
+
+ return "$self->{val}";
+}
+
+1;