From 999f27f7a33f98148ddd1092241ebc5a0dbb157c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Quelin?= Date: Sat, 22 May 2010 18:24:44 +0200 Subject: [PATCH] fix to work with test::simple 0.95 (#57722) --- lib/Language/Befunge/Vector/XS.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Language/Befunge/Vector/XS.pm b/lib/Language/Befunge/Vector/XS.pm index b701677..b50f7a8 100644 --- a/lib/Language/Befunge/Vector/XS.pm +++ b/lib/Language/Befunge/Vector/XS.pm @@ -18,8 +18,9 @@ use overload '-' => \&_substract, 'neg' => \&_invert, '+=' => \&_add_inplace, - '-=' => \&_substract_inplace, + '-=' => \&_substract_inplace, '<=>' => \&_compare, + 'eq' => \&_compare_string, '""' => \&as_string; our $VERSION = '1.1.0'; @@ -35,6 +36,17 @@ sub as_string { return "(@$self)"; } +# +# my $bool = $v->_compare($string); +# my $bool = $v eq $string; +# +# Check whether the vector stringifies to $string. +# +sub _compare_string { + my ($self, $str) = @_; + return $self->as_string eq $str; +} + 1; __END__ -- 2.11.4.GIT