From bed777fe612a0bd8ecfdb2ba6c376360c5be907c Mon Sep 17 00:00:00 2001 From: Lichtkind Date: Sun, 28 Apr 2024 21:22:50 +0200 Subject: [PATCH] fix format tests --- lib/Graphics/Toolkit/Color/Space.pm | 10 +++++----- t/04_space_format.t | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Graphics/Toolkit/Color/Space.pm b/lib/Graphics/Toolkit/Color/Space.pm index 56bed7f..7eaa92b 100644 --- a/lib/Graphics/Toolkit/Color/Space.pm +++ b/lib/Graphics/Toolkit/Color/Space.pm @@ -39,11 +39,11 @@ sub delta { shift->shape->delta( @_ ) } # @+values1, @+valu ######################################################################## -sub format { $_[0]{'format'} } -sub add_formatter { shift->format->add_formatter(@_) } # ~format_name, &formatter --> &| -sub add_deformatter { shift->format->add_deformatter(@_) } # ~format_name, &deformatter --> &| -sub format { shift->format->format(@_) } # @+values, ~format_name -- @~suffix --> $*color -sub deformat { shift->format->deformat(@_) } # $*color-- @~suffix --> @+values +sub form { $_[0]{'format'} } +sub add_formatter { shift->form->add_formatter(@_) } # ~format_name, &formatter --> &| +sub add_deformatter { shift->form->add_deformatter(@_) } # ~format_name, &deformatter --> &| +sub format { shift->form->format(@_) } # @+values, ~format_name -- @~suffix --> $*color +sub deformat { shift->form->deformat(@_) } # $*color-- @~suffix --> @+values #### conversion ######################################################## diff --git a/t/04_space_format.t b/t/04_space_format.t index 1e7131a..0919b5b 100644 --- a/t/04_space_format.t +++ b/t/04_space_format.t @@ -164,8 +164,8 @@ is( $obj->has_format('pstring'), 1, 'there is now a pstring format'); is( $name, undef, 'found no deformatter for pstring format'); is( $obj->has_deformat('pstring'), 0, 'there is no pstring deformatter'); -my $fref = $obj->add_deformatter('pstring', sub { $_[0]->match_number_values( [split(',',substr($_[1],1))] ); }); -is( ref $fref, 'CODE', 'added deformatter'); +my $dref = $obj->add_deformatter('pstring', sub { $_[0]->match_number_values( [split(',',substr($_[1],1))] ); }); +is( ref $dref, 'CODE', 'added deformatter'); is( $obj->has_deformat('pstring'), 1, 'there is now a pstring deformatter'); ($vals, $name) = $obj->deformat( '%0,2.2,-3' );