You're taking it up one level, so extrapolate the argument solution up one level - use a hash of arrays or an array of arrays:
my %functions = ( function1 => {arglist1 => ["arg1", { arg2 => val2 }], arglist2 => [...], ... }, function2 => {...}, ..., ); while (my ($func, $argsList) = each %functions) { for my $key (keys %$argsList) { print "Test $func against args $key\n" &{"harcommon::$func"}(@{$argsList->{$key}}); } }
or:
my %functions = ( function1 => [["arg1", { arg2 => val2 }], [...], ... ], function2 => [...], ..., ); while (my ($func, $argsList) = each %functions) { for my $args (@$argsList) { print "Test $func against args $key\n" &{"harcommon::$func"}(@$args); } }
In reply to Re^3: Data Structures design help to represent function args for testing
by GrandFather
in thread Data Structures design help to represent function args for testing
by goibhniu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |