Skip to content

Commit

Permalink
fix format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lichtkind committed Apr 28, 2024
1 parent 0821194 commit bed777f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/Graphics/Toolkit/Color/Space.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ########################################################

Expand Down
4 changes: 2 additions & 2 deletions t/04_space_format.t
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit bed777f

Please sign in to comment.