gctaylor1 has asked for the wisdom of the Perl Monks concerning the following question:
My module:
My test:#!/usr/bin/perl package Mymodule; use strict; use warnings; require Exporter; our @ISA=qw(Exporter); our @EXPORT_OK = qw( values ); sub values { my $val1 = $_[0]; my $val2 = $_[1]; return ($val1, $val2); } 1;
The results look good:#!/usr/bin/perl use strict; use warnings; use Mymodule qw( values ); use Test::More qw(no_plan); BEGIN { use_ok('Mymodule', qw( values )) }; my $pig = 3; my $cow = 4; is( values($pig, $cow ), (3 and 4), "checking values" ) ;
The question is whether or not using the (3 and 4) in the $expected position is the proper way to do this?ok 1 - use Mymodule; ok 2 - checking values 1..2
but fails:is( values($pig, $cow ), (3, 4), "checking values" ) ;
Any advice? Maybe stop worrying and be happy it works and move on. :)ok 1 - use Mymodule; Useless use of a constant in void context at ./mymodule.t line 12. ok 2 - checking values 1..2
|
|---|