#!/usr/bin/env perl
BEGIN {
$ENV
{RPERL_WARNINGS} = 0; }
our
$VERSION
= 0.011_000;
use
RPerl::DataStructure::Array::SubTypes1D
qw(integer_arrayref_typetest0 integer_arrayref_typetest1 number_arrayref_typetest0 number_arrayref_typetest1 string_arrayref_typetest0 string_arrayref_typetest1)
;
BEGIN {
if
(
$ENV
{RPERL_VERBOSE} ) {
Test::More::diag(
'[[[ Beginning Array Type Pre-Test Loading, RPerl Type System ]]]'
);
}
lives_and(
sub
{ use_ok(
'RPerl::AfterSubclass'
); },
q{use_ok('RPerl::AfterSubclass') lives}
);
lives_and(
sub
{ use_ok(
'RPerl::DataStructure::Array_cpp'
); },
q{use_ok('RPerl::DataStructure::Array_cpp') lives}
);
}
foreach
my
integer
$mode_id
(
sort
keys
%{
$RPerl::MODES
} ) {
my
scalartype_hashref
$mode
=
$RPerl::MODES
->{
$mode_id
};
my
$ops
=
$mode
->{ops};
my
$types
=
$mode
->{types};
my
string
$mode_tagline
=
$ops
.
'OPS_'
.
$types
.
'TYPES'
;
if
(
$ENV
{RPERL_VERBOSE} ) {
Test::More::diag(
'[[[ Beginning RPerl Array Type Tests, '
.
$ops
.
' Operations & '
.
$types
.
' Data Types'
.
' ]]]'
);
}
lives_ok(
sub
{ rperltypes::types_enable(
$types
) },
q{mode '}
.
$ops
. ' Operations &
' . $types . '
Data Types
' . q{'
enabled} );
if
(
$ops
eq
'PERL'
) {
lives_and(
sub
{ use_ok(
'RPerl::DataStructure::Array'
); },
q{use_ok('RPerl::DataStructure::Array') lives}
);
}
else
{
if
(
$types
eq
'CPP'
) {
delete
$main::
{
'RPerl__DataStructure__Array__MODE_ID'
};
}
lives_and(
sub
{ require_ok(
'RPerl::DataStructure::Array_cpp'
); },
q{require_ok('RPerl::DataStructure::Array_cpp') lives}
);
lives_ok(
sub
{ RPerl::DataStructure::Array_cpp::cpp_load(); },
q{RPerl::DataStructure::Array_cpp::cpp_load() lives}
);
}
foreach
my
string
$type
(
qw(DataType__Integer DataType__Number DataType__String DataStructure__Array)
) {
lives_and(
sub
{
is(
$RPerl::MODES
->{ main->can(
'RPerl__'
.
$type
.
'__MODE_ID'
)->() }->{ops},
$ops
,
'main::RPerl__'
.
$type
.
'__MODE_ID() ops returns '
.
$ops
);
},
'main::RPerl__'
.
$type
.
'__MODE_ID() lives'
);
lives_and(
sub
{
is(
$RPerl::MODES
->{ main->can(
'RPerl__'
.
$type
.
'__MODE_ID'
)->() }->{types},
$types
,
'main::RPerl__'
.
$type
.
'__MODE_ID() types returns '
.
$types
);
},
'main::RPerl__'
.
$type
.
'__MODE_ID() lives'
);
}
throws_ok(
sub
{ integer_arrayref_to_string() },
"/(EIVAVRV00.*$mode_tagline)|(Usage.*integer_arrayref_to_string)/"
,
q{TIVAVRV00 integer_arrayref_to_string() throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_to_string(
undef
) },
"/EIVAVRV00.*$mode_tagline/"
,
q{TIVAVRV01 integer_arrayref_to_string(undef) throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_to_string(2) },
"/EIVAVRV01.*$mode_tagline/"
,
q{TIVAVRV02 integer_arrayref_to_string(2) throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_to_string(2.3) },
"/EIVAVRV01.*$mode_tagline/"
,
q{TIVAVRV03 integer_arrayref_to_string(2.3) throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_to_string(
'2'
) },
"/EIVAVRV01.*$mode_tagline/"
,
q{TIVAVRV04 integer_arrayref_to_string('2') throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_to_string( {
a_key
=> 23 } ) },
"/EIVAVRV01.*$mode_tagline/"
,
q{TIVAVRV05 integer_arrayref_to_string({a_key => 23}
) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_to_string( [ 2, 2_112,
undef
, 23, -877, -33, 1_701 ] );
},
"/EIVAVRV02.*$mode_tagline/"
,
q{TIVAVRV10 integer_arrayref_to_string([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_to_string( [ 2, 2_112, 42, 23.3, -877, -33, 1_701 ] );
},
"/EIVAVRV03.*$mode_tagline/"
,
q{TIVAVRV11 integer_arrayref_to_string([ 2, 2_112, 42, 23.3, -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_to_string( [ 2, 2_112, 42,
'23'
, -877, -33, 1_701 ] );
},
"/EIVAVRV03.*$mode_tagline/"
,
q{TIVAVRV12 integer_arrayref_to_string([ 2, 2_112, 42, '23', -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_to_string( [ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ] );
},
"/EIVAVRV03.*$mode_tagline/"
,
q{TIVAVRV13 integer_arrayref_to_string([ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_to_string( [ 2, 2_112, 42, {
a_subkey
=> 23 }, -877, -33, 1_701 ] );
},
"/EIVAVRV03.*$mode_tagline/"
,
q{TIVAVRV14 integer_arrayref_to_string([ 2, 2_112, 42, {a_subkey => 23}
, -877, -33, 1_701 ]) throws correct exception}
);
lives_and(
sub
{
is( integer_arrayref_to_string( [ 23 ] ),
'[ 23 ]'
,
q{TIVAVRV20 integer_arrayref_to_string([ 23 ]) returns correct value}
);
},
q{TIVAVRV20 integer_arrayref_to_string([ 23 ]) lives}
);
lives_and(
sub
{
is( integer_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21a integer_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TIVAVRV21a integer_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( integer_arrayref_to_string(
my
integer_arrayref
$foo
= [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21b integer_arrayref_to_string( my integer_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TIVAVRV21b integer_arrayref_to_string( my integer_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( integer_arrayref_to_string(
bless
[ 2, 2_112, 42, 23, -877, -33, 1_701 ],
'integer_arrayref'
),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21c integer_arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'integer_arrayref' ) returns correct value}
);
},
q{TIVAVRV21c integer_arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'integer_arrayref' ) lives}
);
lives_and(
sub
{
is( arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21d arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TIVAVRV21d arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
my
integer_arrayref
$foo
= [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21e arrayref_to_string( my integer_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TIVAVRV21e arrayref_to_string( my integer_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
bless
[ 2, 2_112, 42, 23, -877, -33, 1_701 ],
'integer_arrayref'
),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TIVAVRV21f arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'integer_arrayref' ) returns correct value}
);
},
q{TIVAVRV21f arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'integer_arrayref' ) lives}
);
throws_ok(
sub
{ integer_arrayref_typetest0() },
"/(EIVAVRV00.*$mode_tagline)|(Usage.*integer_arrayref_typetest0)/"
,
q{TIVAVRV30 integer_arrayref_typetest0() throws correct exception}
);
throws_ok(
sub
{ integer_arrayref_typetest0(2) },
"/EIVAVRV01.*$mode_tagline/"
,
q{TIVAVRV31 integer_arrayref_typetest0(2) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_typetest0( [ 2, 2_112,
undef
, 23, -877, -33, 1_701 ] );
},
"/EIVAVRV02.*$mode_tagline/"
,
q{TIVAVRV32 integer_arrayref_typetest0([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
integer_arrayref_typetest0( [ 2, 2_112, 42,
'abcdefg'
, -877, -33, 1_701 ] );
},
"/EIVAVRV03.*$mode_tagline/"
,
q{TIVAVRV33 integer_arrayref_typetest0([ 2, 2_112, 42, 'abcdefg', -877, -33, 1_701 ]) throws correct exception}
);
lives_and(
sub
{
is( integer_arrayref_typetest0( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
.
$mode_tagline
,
q{TIVAVRV34 integer_arrayref_typetest0([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) returns correct value}
);
},
q{TIVAVRV34 integer_arrayref_typetest0([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) lives}
);
lives_and(
sub
{
is_deeply( integer_arrayref_typetest1(5), [ 0, 5, 10, 15, 20 ],
q{TIVAVRV40 integer_arrayref_typetest1(5) returns correct value}
);
},
q{TIVAVRV40 integer_arrayref_typetest1(5) lives}
);
throws_ok(
sub
{ number_arrayref_to_string() },
"/(ENVAVRV00.*$mode_tagline)|(Usage.*number_arrayref_to_string)/"
,
q{TNVAVRV00 number_arrayref_to_string() throws correct exception}
);
throws_ok(
sub
{ number_arrayref_to_string(
undef
) },
"/E(NV)?AVRV00.*$mode_tagline/"
,
q{TNVAVRV01 number_arrayref_to_string(undef) throws correct exception}
);
throws_ok(
sub
{ number_arrayref_to_string(2) },
"/E(NV)?AVRV01.*$mode_tagline/"
,
q{TNVAVRV02 number_arrayref_to_string(2) throws correct exception}
);
throws_ok(
sub
{ number_arrayref_to_string(2.3) },
"/E(NV)?AVRV01.*$mode_tagline/"
,
q{TNVAVRV03 number_arrayref_to_string(2.3) throws correct exception}
);
throws_ok(
sub
{ number_arrayref_to_string(
'2'
) },
"/E(NV)?AVRV01.*$mode_tagline/"
,
q{TNVAVRV04 number_arrayref_to_string('2') throws correct exception}
);
throws_ok(
sub
{ number_arrayref_to_string( {
a_key
=> 23 } ) },
"/E(NV)?AVRV01.*$mode_tagline/"
,
q{TNVAVRV05 number_arrayref_to_string({a_key => 23}
) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_to_string( [ 2, 2_112,
undef
, 23, -877, -33, 1_701 ] );
},
"/ENVAVRV02.*$mode_tagline/"
,
q{TNVAVRV10 number_arrayref_to_string([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_to_string( [ 2, 2_112, 42,
'23'
, -877, -33, 1_701 ] );
},
"/ENVAVRV03.*$mode_tagline/"
,
q{TNVAVRV11 number_arrayref_to_string([ 2, 2_112, 42, '23', -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_to_string( [ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ] );
},
"/ENVAVRV03.*$mode_tagline/"
,
q{TNVAVRV12 number_arrayref_to_string([ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ]) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_to_string( [ 2, 2_112, 42, {
a_subkey
=> 23 }, -877, -33, 1_701 ] );
},
"/ENVAVRV03.*$mode_tagline/"
,
q{TNVAVRV13 number_arrayref_to_string([ 2, 2_112, 42, {a_subkey => 23}
, -877, -33, 1_701 ]) throws correct exception}
);
lives_and(
sub
{
is( number_arrayref_to_string( [ 23 ] ),
'[ 23 ]'
,
q{TNVAVRV20 number_arrayref_to_string([ 23 ]) returns correct value}
);
},
q{TNVAVRV20 number_arrayref_to_string([ 23 ]) lives}
);
lives_and(
sub
{
is( number_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21a number_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TNVAVRV21a number_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( number_arrayref_to_string(
my
number_arrayref
$foo
= [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21b number_arrayref_to_string( my number_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TNVAVRV21b number_arrayref_to_string( my number_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( number_arrayref_to_string(
bless
[ 2, 2_112, 42, 23, -877, -33, 1_701 ],
'number_arrayref'
),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21c number_arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'number_arrayref' ) returns correct value}
);
},
q{TNVAVRV21c number_arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'number_arrayref' ) lives}
);
lives_and(
sub
{
is( arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21d arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TNVAVRV21d arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
my
number_arrayref
$foo
= [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21e arrayref_to_string( my number_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) returns correct value}
);
},
q{TNVAVRV21e arrayref_to_string( my number_arrayref $foo = [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
bless
[ 2, 2_112, 42, 23, -877, -33, 1_701 ],
'number_arrayref'
),
'[ 2, 2_112, 42, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV21f arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'number_arrayref' ) returns correct value}
);
},
q{TNVAVRV21f arrayref_to_string( bless [ 2, 2_112, 42, 23, -877, -33, 1_701 ], 'number_arrayref' ) lives}
);
lives_and(
sub
{
is( number_arrayref_to_string( [ 23.2 ] ),
'[ 23.2 ]'
,
q{TNVAVRV22 number_arrayref_to_string([ 23.2 ]) returns correct value}
);
},
q{TNVAVRV22 number_arrayref_to_string([ 23.2 ]) lives}
);
lives_and(
sub
{
is( number_arrayref_to_string( [ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ] ),
'[ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]'
,
q{TNVAVRV23 number_arrayref_to_string([ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]) returns correct value}
);
},
q{TNVAVRV23 number_arrayref_to_string([ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]) lives}
);
lives_and(
sub
{
my
string
$tmp_retval
= number_arrayref_to_string( [ 2.123_443_211_234_432_1, 2_112.432_1, 42.456_7, 23.765_444_444_444_444_444, -877.567_8, -33.876_587_658_765_875_687_658_765, 1_701.678_9 ] );
like(
$tmp_retval
,
qr/\[ 2\.123_443_211/
,
q{TNVAVRV24a number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value, array beginning}
);
like(
$tmp_retval
,
qr/, 1_701\.678_9 \]/
,
q{TNVAVRV24b number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value, array end}
);
},
q{TNVAVRV24 number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
);
throws_ok(
sub
{ number_arrayref_typetest0() },
"/(ENVAVRV00.*$mode_tagline)|(Usage.*number_arrayref_typetest0)/"
,
q{TNVAVRV30 number_arrayref_typetest0() throws correct exception}
);
throws_ok(
sub
{ number_arrayref_typetest0(2) },
"/ENVAVRV01.*$mode_tagline/"
,
q{TNVAVRV31 number_arrayref_typetest0(2) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_typetest0( [ 2.123_443_211_234_432_1, 2_112.432_1,
undef
, 23.765_444_444_444_444_444, -877.567_8, -33.876_587_658_765_875_687_658_765, 1_701.678_9 ] );
},
"/ENVAVRV02.*$mode_tagline/"
,
q{TNVAVRV32 number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, undef, 23.765_444_444_444_444_444, ..., 1_701.678_9 ]) throws correct exception}
);
throws_ok(
sub
{
number_arrayref_typetest0(
[ 2.123_443_211_234_432_1, 2_112.432_1, 42.456_7, 23.765_444_444_444_444_444, -877.567_8,
'abcdefg'
, -33.876_587_658_765_875_687_658_765, 1_701.678_9 ] );
},
"/ENVAVRV03.*$mode_tagline/"
,
q{TNVAVRV33 number_arrayref_typetest0([ 2.123_443_211_234_432_1, ..., 'abcdefg', -33.876_587_658_765_875_687_658_765, 1_701.678_9 ]) throws correct exception}
);
lives_and(
sub
{
my
string
$tmp_retval
= number_arrayref_typetest0( [ 2.123_443_211_234_432_1, 2_112.432_1, 42.456_7, 23.765_444_444_444_444_444, -877.567_8, -33.876_587_658_765_875_687_658_765, 1_701.678_9 ] );
like(
$tmp_retval
,
qr/\[ 2\.123_443_211/
,
q{TNVAVRV34a number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value, array beginning}
);
like(
$tmp_retval
,
qr/, 1_701\.678_9 \]/
,
q{TNVAVRV34b number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value, array end}
);
like(
$tmp_retval
,
qr/$mode_tagline/
,
q{TNVAVRV34c number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value, mode tagline}
);
},
q{TNVAVRV34 number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
);
lives_and(
sub
{
delta_ok(
number_arrayref_typetest1(5),
[ 0, 5.123456789, 10.246913578, 15.370370367, 20.493827156 ]
,
q{TNVAVRV40 number_arrayref_typetest1(5) returns correct value}
);
},
q{TNVAVRV40 number_arrayref_typetest1(5) lives}
);
throws_ok(
sub
{ string_arrayref_to_string() },
"/(EPVAVRV00.*$mode_tagline)|(Usage.*string_arrayref_to_string)/"
,
q{TPVAVRV00 string_arrayref_to_string() throws correct exception}
);
throws_ok(
sub
{ string_arrayref_to_string(
undef
) },
"/EPVAVRV00.*$mode_tagline/"
,
q{TPVAVRV01 string_arrayref_to_string(undef) throws correct exception}
);
throws_ok(
sub
{ string_arrayref_to_string(2) },
"/EPVAVRV01.*$mode_tagline/"
,
q{TPVAVRV02 string_arrayref_to_string(2) throws correct exception}
);
throws_ok(
sub
{ string_arrayref_to_string(2.3) },
"/EPVAVRV01.*$mode_tagline/"
,
q{TPVAVRV03 string_arrayref_to_string(2.3) throws correct exception}
);
throws_ok(
sub
{ string_arrayref_to_string(
'Lone Ranger'
) },
"/EPVAVRV01.*$mode_tagline/"
,
q{TPVAVRV04 string_arrayref_to_string('Lone Ranger') throws correct exception}
);
throws_ok(
sub
{ string_arrayref_to_string( {
a_key
=>
'Lone Ranger'
} ) },
"/EPVAVRV01.*$mode_tagline/"
,
q{TPVAVRV05 string_arrayref_to_string({a_key => 'Lone Ranger'}
) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_to_string( [
'Superman'
,
'Batman'
,
'Wonder Woman'
,
undef
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV02.*$mode_tagline/"
,
q{TPVAVRV10 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_to_string( [
'Superman'
,
'Batman'
, 23,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV03.*$mode_tagline/"
,
q{TPVAVRV11 string_arrayref_to_string([ 'Superman', 'Batman', 23, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_to_string( [
'Superman'
,
'Batman'
, 23.2,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV03.*$mode_tagline/"
,
q{TPVAVRV12 string_arrayref_to_string([ 'Superman', 'Batman', 23.2, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_to_string( [
'Superman'
,
'Batman'
, [
'Wonder Woman'
],
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV03.*$mode_tagline/"
,
q{TPVAVRV13 string_arrayref_to_string([ 'Superman', 'Batman', ['Wonder Woman'], 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_to_string( [
'Superman'
,
'Batman'
, {
a_subkey
=>
'Wonder Woman'
},
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV03.*$mode_tagline/"
,
q{TPVAVRV14 string_arrayref_to_string([ 'Superman', 'Batman', {a_subkey => 'Wonder Woman'}
, ...,
'Martian Manhunter'
]) throws correct exception}
);
lives_and(
sub
{
is( string_arrayref_to_string(
[
'Howard The Duck'
]
),
q{[ 'Howard The Duck' ]}
,
q{TPVAVRV20 string_arrayref_to_string([ 'Howard The Duck' ]) returns correct value}
);
},
q{TPVAVRV20 string_arrayref_to_string([ 'Howard The Duck' ]) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] ),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21a string_arrayref_to_string( [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) returns correct value}
);
},
q{TPVAVRV21a string_arrayref_to_string( [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string(
my
string_arrayref
$foo
= [
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] ),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21b string_arrayref_to_string( my string_arrayref $foo = [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) returns correct value}
);
},
q{TPVAVRV21b string_arrayref_to_string( my string_arrayref $foo = [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string(
bless
[
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
],
'string_arrayref'
),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21c string_arrayref_to_string( bless [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ], 'string_arrayref' ) returns correct value}
);
},
q{TPVAVRV21c string_arrayref_to_string( bless [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ], 'string_arrayref' ) lives}
);
lives_and(
sub
{
is( arrayref_to_string( [
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] ),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21d arrayref_to_string( [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) returns correct value}
);
},
q{TPVAVRV21d arrayref_to_string( [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
my
string_arrayref
$foo
= [
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] ),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21e arrayref_to_string( my string_arrayref $foo = [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) returns correct value}
);
},
q{TPVAVRV21e arrayref_to_string( my string_arrayref $foo = [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ] ) lives}
);
lives_and(
sub
{
is( arrayref_to_string(
bless
[
'Howard The Duck'
,
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
],
'string_arrayref'
),
q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
,
q{TPVAVRV21f arrayref_to_string( bless [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ], 'string_arrayref' ) returns correct value}
);
},
q{TPVAVRV21f arrayref_to_string( bless [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ], 'string_arrayref' ) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Superman'
,
'Martian Manhunter'
,
'undef'
] ),
q{[ 'Superman', 'Martian Manhunter', 'undef' ]}
,
q{TPVAVRV22 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', 'undef' ]) returns correct value}
);
},
q{TPVAVRV22 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', 'undef' ]) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Superman'
,
'Martian Manhunter'
,
'23'
] ),
q{[ 'Superman', 'Martian Manhunter', '23' ]}
,
q{TPVAVRV23 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '23' ]) returns correct value}
);
},
q{TPVAVRV23 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '23' ]) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Superman'
,
'Martian Manhunter'
,
'-2_112.23'
] ),
q{[ 'Superman', 'Martian Manhunter', '-2_112.23' ]}
,
q{TPVAVRV24 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '-2_112.23' ]) returns correct value}
);
},
q{TPVAVRV24 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter', '-2_112.23' ]) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Superman'
,
'Martian Manhunter'
,
"[\\'Tonto'\\]"
] ),
q{[ 'Superman', 'Martian Manhunter', '[\\\\\'Tonto\'\\\\]' ]}
,
q{TPVAVRV25 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', "[\\'Tonto'\\]" ]) returns correct value}
);
},
q{TPVAVRV25 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', "Martian Manhunter", "-2_112.23" ]) lives}
);
lives_and(
sub
{
is( string_arrayref_to_string( [
'Superman'
,
'Martian Manhunter'
,
'{buzz => 5}'
] ),
q{[ 'Superman', 'Martian Manhunter', '{buzz => 5}
' ]},
q{TPVAVRV26 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '{buzz => 5}
' ]) returns correct value}
);
},
q{TPVAVRV26 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '{buzz => 5}
' ]) lives}
);
throws_ok(
sub
{ string_arrayref_typetest0() },
"/(EPVAVRV00.*$mode_tagline)|(Usage.*string_arrayref_typetest0)/"
,
q{TPVAVRV30 string_arrayref_typetest0() throws correct exception}
);
throws_ok(
sub
{ string_arrayref_typetest0(2) },
"/EPVAVRV01.*$mode_tagline/"
,
q{TPVAVRV31 string_arrayref_typetest0(2) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_typetest0( [
'Superman'
,
'Batman'
,
'Wonder Woman'
,
undef
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] );
},
"/EPVAVRV02.*$mode_tagline/"
,
q{TPVAVRV32 string_arrayref_typetest0([ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
);
throws_ok(
sub
{
string_arrayref_typetest0( [
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
, [ 23, -42.3 ] ] );
},
"/EPVAVRV03.*$mode_tagline/"
,
q{TPVAVRV33 string_arrayref_typetest0([ 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter', [ 23, -42.3 ] ]) throws correct exception}
);
lives_and(
sub
{
is( string_arrayref_typetest0( [
'Superman'
,
'Batman'
,
'Wonder Woman'
,
'Flash'
,
'Green Lantern'
,
'Aquaman'
,
'Martian Manhunter'
] ),
q{[ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]}
.
$mode_tagline
,
q{TPVAVRV34 string_arrayref_typetest0([ 'Superman', ..., 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) returns correct value}
);
},
q{TPVAVRV34 string_arrayref_typetest0([ 'Superman', ..., 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) lives}
);
lives_and(
sub
{
is_deeply(
string_arrayref_typetest1(5),
[
'Jeffy Ten! 0/4 '
.
$mode_tagline
,
'Jeffy Ten! 1/4 '
.
$mode_tagline
,
'Jeffy Ten! 2/4 '
.
$mode_tagline
,
'Jeffy Ten! 3/4 '
.
$mode_tagline
,
'Jeffy Ten! 4/4 '
.
$mode_tagline
,
],
q{TPVAVRV40 string_arrayref_typetest1(5) returns correct value}
);
},
q{TPVAVRV40 string_arrayref_typetest1(5) lives}
);
}
done_testing();