Skip Menu |

This queue is for tickets about the Acme-MetaSyntactic CPAN distribution.

Report information
The Basics
Id: 40116
Status: resolved
Priority: 0/
Queue: Acme-MetaSyntactic

People
Owner: Nobody in particular
Requestors: J2N-FORGET [...] orange.fr
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.99
Fixed in: 0.99_05



Subject: inconsistency between List and Multilist
In A::MS::List, the init function accepts a $data argument, to override reading from the DATA filehandle: sub init { my ($self, $data) = @_; my $class = caller(0); $data ||= Acme::MetaSyntactic->load_data($class); In A::MS::Multilist, the init function ignores any $data argument: sub init { my $class = caller(0); my $data = Acme::MetaSyntactic->load_data($class); It would be nice if both functions would have the same behaviour (preferably the first one, to prevent breaking tour_de_france, olympics and good_omens)
Here is a test script for this ticket
# # Test script for ticket RT 40116 # use strict; use Test::More; package Acme::MetaSyntactic::yeye; use Acme::MetaSyntactic::MultiList; our @ISA = qw( Acme::MetaSyntactic::MultiList ); my $real_names = { default => 'chats_sauvages', idole_des_jeunes => "Jean_Philippe Smet", chaussettes_noires => "Claude Moine", chats_sauvages => "Herve Fornieri", }; __PACKAGE__->init($real_names); package main; plan('tests', 7); is( $Acme::MetaSyntactic::yeye::Default, 'chats_sauvages', "Default category"); is( $Acme::MetaSyntactic::yeye::MultiList{idole_des_jeunes}[0], 'Jean_Philippe', 'Christian name of idole des jeunes'); is( $Acme::MetaSyntactic::yeye::MultiList{idole_des_jeunes}[1], 'Smet', 'Surname of idole des jeunes'); is( $Acme::MetaSyntactic::yeye::MultiList{chaussettes_noires}[0], 'Claude', 'Christian name of the singer of chaussettes noires'); is( $Acme::MetaSyntactic::yeye::MultiList{chaussettes_noires}[1], 'Moine', 'Surname of the singer of chaussettes noires'); is( $Acme::MetaSyntactic::yeye::MultiList{chats_sauvages}[0], 'Herve', 'Christian name of the singer of chats sauvages'); is( $Acme::MetaSyntactic::yeye::MultiList{chats_sauvages}[1], 'Fornieri', 'Surname of the singer of chats sauvages'); package Acme::MetaSyntactic::yeye; __DATA__ # default chaussettes_noires # names idole_des_jeunes Johnny Halliday # names chaussettes_noires Eddy Mitchell # names chats_sauvages Dick Rivers