summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Test/Deep/Blessed.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Test/Deep/Blessed.pm')
-rwxr-xr-xMaster/tlpkg/tlperl/lib/Test/Deep/Blessed.pm47
1 files changed, 47 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Test/Deep/Blessed.pm b/Master/tlpkg/tlperl/lib/Test/Deep/Blessed.pm
new file mode 100755
index 00000000000..62fdc48c358
--- /dev/null
+++ b/Master/tlpkg/tlperl/lib/Test/Deep/Blessed.pm
@@ -0,0 +1,47 @@
+use strict;
+use warnings;
+
+package Test::Deep::Blessed;
+
+use Test::Deep::Cmp;
+
+use Scalar::Util qw( blessed );
+
+sub init
+{
+ my $self = shift;
+
+ my $val = shift;
+
+ $self->{val} = $val;
+}
+
+sub descend
+{
+ my $self = shift;
+ my $got = shift;
+
+ my $exp = $self->{val};
+ my $blessed = blessed($got);
+
+ return Test::Deep::descend($blessed, Test::Deep::shallow($exp));
+}
+
+sub render_stack
+{
+ my $self = shift;
+ my $var = shift;
+
+ return "blessed($var)"
+}
+
+sub renderGot
+{
+ my $self = shift;
+
+ my $got = shift;
+
+ $self->SUPER::renderGot(blessed($got));
+}
+
+1;