cmp_deeply( $obj, listmethods( name => "John", ["favourites", "food"] => ["Mapo tofu", "Gongbao chicken"] ) ); #### is($obj->name, "John", '... our name is John); is_deeply([$obj->favourites("food")], ["Mapo tofu", "Gongbao chicken"]); #### my $report = do($tree_file) || die "failed to load the report tree\n=> $@\n"; my $is_string = re('^(\s|\w|\d)*$'); my $is_module_name = re('^(([a-zA-Z0-9_]+)\:\:([a-zA-Z0-9_]+))+$'); cmp_deeply( $report, all( isa("ARRAY"), array_each( subhashof({ report_type => $is_string, report_module => $is_module_name, graphing_modules => isa("HASH"), question_groups => all( isa("ARRAY"), array_each( subhashof({ question_group => $is_string, report_module => $is_module_name, graphing_modules => isa("HASH"), questions => all( isa("ARRAY"), array_each(re('^\d+$')) ) # all }) # subhashof ) # array_each ) # all }) # subhashof ) # array_each ) # all ); # cmp_deeply