"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/t/05_type_array.t" (30 Aug 2019, 31790 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "05_type_array.t": 4.001000_vs_4.002000.

    1 #!/usr/bin/env perl
    2 
    3 # [[[ PRE-HEADER ]]]
    4 # suppress 'WEXRP00: Found multiple rperl executables' due to blib/ & pre-existing installation(s)
    5 BEGIN { $ENV{RPERL_WARNINGS} = 0; }
    6 
    7 # [[[ HEADER ]]]
    8 use strict;
    9 use warnings;
   10 use RPerl::AfterSubclass;
   11 our $VERSION = 0.010_000;
   12 
   13 # [[[ CRITICS ]]]
   14 ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
   15 ## no critic qw(ProhibitStringySplit ProhibitInterpolationOfLiterals)  # DEVELOPER DEFAULT 2: allow string test values
   16 ## no critic qw(RequireInterpolationOfMetachars)  # USER DEFAULT 2: allow single-quoted control characters & sigils
   17 
   18 # [[[ INCLUDES ]]]
   19 use RPerl::Test;
   20 use Test::More tests => 232;
   21 #use Test::More tests => 155;  # TMP DEBUG PERLOPS_PERLTYPES & CPPOPS_PERLTYPES
   22 #use Test::More tests => 78;    # TMP DEBUG, ONE MODE ONLY
   23 use Test::Exception;
   24 use Test::Number::Delta;
   25 use RPerl::DataStructure::Array::SubTypes1D qw(integer_arrayref_typetest0 integer_arrayref_typetest1 number_arrayref_typetest0 number_arrayref_typetest1 string_arrayref_typetest0 string_arrayref_typetest1);
   26 
   27 # [[[ OPERATIONS ]]]
   28 
   29 BEGIN {
   30     if ( $ENV{RPERL_VERBOSE} ) {
   31         Test::More::diag('[[[ Beginning Array Type Pre-Test Loading, RPerl Type System ]]]');
   32     }
   33     lives_and( sub { use_ok('RPerl::AfterSubclass'); }, q{use_ok('RPerl::AfterSubclass') lives} );
   34     lives_and( sub { use_ok('RPerl::DataStructure::Array_cpp'); }, q{use_ok('RPerl::DataStructure::Array_cpp') lives} );
   35 }
   36 
   37 # [[[ PRIMARY RUNLOOP ]]]
   38 # [[[ PRIMARY RUNLOOP ]]]
   39 # [[[ PRIMARY RUNLOOP ]]]
   40 
   41 # loop 3 times, once for each mode: PERLOPS_PERLTYPES, PERLOPS_CPPTYPES, CPPOPS_CPPTYPES
   42 foreach my integer $mode_id ( sort keys %{$RPerl::MODES} ) {
   43 #for my $mode_id ( 0 .. 0 ) {  # TMP DEBUG, PERLOPS_PERLTYPES ONLY
   44 #for my $mode_id ( 1 .. 1 ) {  # TMP DEBUG, CPPOPS_PERLTYPES ONLY
   45 #for my $mode_id ( 0 .. 1 ) {  # TMP DEBUG, PERLOPS_PERLTYPES & CPPOPS_PERLTYPES
   46 #for my $mode_id ( 2 .. 2 ) {  # TMP DEBUG, CPPOPS_CPPTYPES ONLY
   47 
   48     # [[[ MODE SETUP ]]]
   49     #    RPerl::diag("in 05_type_array.t, top of for() loop, have \$mode_id = $mode_id\n");
   50     my scalartype_hashref $mode = $RPerl::MODES->{$mode_id};
   51     my $ops                 = $mode->{ops};
   52     my $types               = $mode->{types};
   53     my string $mode_tagline = $ops . 'OPS_' . $types . 'TYPES';
   54     if ( $ENV{RPERL_VERBOSE} ) {
   55         Test::More::diag( '[[[ Beginning RPerl Array Type Tests, ' . $ops . ' Operations & ' . $types . ' Data Types' . ' ]]]' );
   56     }
   57 
   58     lives_ok( sub { rperltypes::types_enable($types) }, q{mode '} . $ops . ' Operations & ' . $types . ' Data Types' . q{' enabled} );
   59 
   60     if ( $ops eq 'PERL' ) {
   61         lives_and( sub { use_ok('RPerl::DataStructure::Array'); }, q{use_ok('RPerl::DataStructure::Array') lives} );
   62     }
   63     else {
   64         if ( $types eq 'CPP' ) {
   65 
   66             # force reload
   67             delete $main::{'RPerl__DataStructure__Array__MODE_ID'};
   68         }
   69 
   70         # C++ use, load, link
   71         lives_and( sub { require_ok('RPerl::DataStructure::Array_cpp'); }, q{require_ok('RPerl::DataStructure::Array_cpp') lives} );
   72         lives_ok( sub { RPerl::DataStructure::Array_cpp::cpp_load(); }, q{RPerl::DataStructure::Array_cpp::cpp_load() lives} );
   73     }
   74 
   75     foreach my string $type (qw(DataType__Integer DataType__Number DataType__String DataStructure__Array)) {
   76         lives_and(
   77             sub {
   78                 is( $RPerl::MODES->{ main->can( 'RPerl__' . $type . '__MODE_ID' )->() }->{ops},
   79                     $ops, 'main::RPerl__' . $type . '__MODE_ID() ops returns ' . $ops );
   80             },
   81             'main::RPerl__' . $type . '__MODE_ID() lives'
   82         );
   83         lives_and(
   84             sub {
   85                 is( $RPerl::MODES->{ main->can( 'RPerl__' . $type . '__MODE_ID' )->() }->{types},
   86                     $types, 'main::RPerl__' . $type . '__MODE_ID() types returns ' . $types );
   87             },
   88             'main::RPerl__' . $type . '__MODE_ID() lives'
   89         );
   90     }
   91 
   92     # [[[ INTEGER ARRAY TESTS ]]]
   93     # [[[ INTEGER ARRAY TESTS ]]]
   94     # [[[ INTEGER ARRAY TESTS ]]]
   95 
   96     throws_ok(    # TIVAVRV00
   97         sub { integer_arrayref_to_string() },
   98         "/(EIVAVRV00.*$mode_tagline)|(Usage.*integer_arrayref_to_string)/",    # DEV NOTE: 2 different error messages, RPerl & C
   99         q{TIVAVRV00 integer_arrayref_to_string() throws correct exception}
  100     );
  101     throws_ok(                                                                 # TIVAVRV01
  102         sub { integer_arrayref_to_string(undef) },
  103         "/EIVAVRV00.*$mode_tagline/",
  104         q{TIVAVRV01 integer_arrayref_to_string(undef) throws correct exception}
  105     );
  106     throws_ok(                                                                 # TIVAVRV02
  107         sub { integer_arrayref_to_string(2) },
  108         "/EIVAVRV01.*$mode_tagline/",
  109         q{TIVAVRV02 integer_arrayref_to_string(2) throws correct exception}
  110     );
  111     throws_ok(                                                                 # TIVAVRV03
  112         sub { integer_arrayref_to_string(2.3) },
  113         "/EIVAVRV01.*$mode_tagline/",
  114         q{TIVAVRV03 integer_arrayref_to_string(2.3) throws correct exception}
  115     );
  116     throws_ok(                                                                 # TIVAVRV04
  117         sub { integer_arrayref_to_string('2') },
  118         "/EIVAVRV01.*$mode_tagline/",
  119         q{TIVAVRV04 integer_arrayref_to_string('2') throws correct exception}
  120     );
  121     throws_ok(                                                                 # TIVAVRV05
  122         sub { integer_arrayref_to_string( { a_key => 23 } ) },
  123         "/EIVAVRV01.*$mode_tagline/",
  124         q{TIVAVRV05 integer_arrayref_to_string({a_key => 23}) throws correct exception}
  125     );
  126     throws_ok(                                                                 # TIVAVRV10
  127         sub {
  128             integer_arrayref_to_string( [ 2, 2_112, undef, 23, -877, -33, 1_701 ] );
  129         },
  130         "/EIVAVRV02.*$mode_tagline/",
  131         q{TIVAVRV10 integer_arrayref_to_string([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
  132     );
  133     throws_ok(                                                                 # TIVAVRV11
  134         sub {
  135             integer_arrayref_to_string( [ 2, 2_112, 42, 23.3, -877, -33, 1_701 ] );
  136         },
  137         "/EIVAVRV03.*$mode_tagline/",
  138         q{TIVAVRV11 integer_arrayref_to_string([ 2, 2_112, 42, 23.3, -877, -33, 1_701 ]) throws correct exception}
  139     );
  140     throws_ok(                                                                 # TIVAVRV12
  141         sub {
  142             integer_arrayref_to_string( [ 2, 2_112, 42, '23', -877, -33, 1_701 ] );
  143         },
  144         "/EIVAVRV03.*$mode_tagline/",
  145         q{TIVAVRV12 integer_arrayref_to_string([ 2, 2_112, 42, '23', -877, -33, 1_701 ]) throws correct exception}
  146     );
  147     throws_ok(                                                                 # TIVAVRV13
  148         sub {
  149             integer_arrayref_to_string( [ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ] );
  150         },
  151         "/EIVAVRV03.*$mode_tagline/",
  152         q{TIVAVRV13 integer_arrayref_to_string([ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ]) throws correct exception}
  153     );
  154     throws_ok(                                                                 # TIVAVRV14
  155         sub {
  156             integer_arrayref_to_string( [ 2, 2_112, 42, { a_subkey => 23 }, -877, -33, 1_701 ] );
  157         },
  158         "/EIVAVRV03.*$mode_tagline/",
  159         q{TIVAVRV14 integer_arrayref_to_string([ 2, 2_112, 42, {a_subkey => 23}, -877, -33, 1_701 ]) throws correct exception}
  160     );
  161     lives_and(                                                                 # TIVAVRV20
  162         sub {
  163             is( integer_arrayref_to_string( [ 23 ] ), '[ 23 ]', q{TIVAVRV20 integer_arrayref_to_string([ 23 ]) returns correct value} );
  164         },
  165         q{TIVAVRV20 integer_arrayref_to_string([ 23 ]) lives}
  166     );
  167     lives_and(                                                                 # TIVAVRV21
  168         sub {
  169             is( integer_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
  170                 '[ 2, 2_112, 42, 23, -877, -33, 1_701 ]',
  171                 q{TIVAVRV21 integer_arrayref_to_string([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) returns correct value}
  172             );
  173         },
  174         q{TIVAVRV21 integer_arrayref_to_string([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) lives}
  175     );
  176     throws_ok(                                                                 # TIVAVRV30
  177         sub { integer_arrayref_typetest0() },
  178         "/(EIVAVRV00.*$mode_tagline)|(Usage.*integer_arrayref_typetest0)/",    # DEV NOTE: 2 different error messages, RPerl & C
  179         q{TIVAVRV30 integer_arrayref_typetest0() throws correct exception}
  180     );
  181     throws_ok(                                                                  # TIVAVRV31
  182         sub { integer_arrayref_typetest0(2) },
  183         "/EIVAVRV01.*$mode_tagline/",
  184         q{TIVAVRV31 integer_arrayref_typetest0(2) throws correct exception}
  185     );
  186     throws_ok(                                                                  # TIVAVRV32
  187         sub {
  188             integer_arrayref_typetest0( [ 2, 2_112, undef, 23, -877, -33, 1_701 ] );
  189         },
  190         "/EIVAVRV02.*$mode_tagline/",
  191         q{TIVAVRV32 integer_arrayref_typetest0([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
  192     );
  193     throws_ok(                                                                  # TIVAVRV33
  194         sub {
  195             integer_arrayref_typetest0( [ 2, 2_112, 42, 'abcdefg', -877, -33, 1_701 ] );
  196         },
  197         "/EIVAVRV03.*$mode_tagline/",
  198         q{TIVAVRV33 integer_arrayref_typetest0([ 2, 2_112, 42, 'abcdefg', -877, -33, 1_701 ]) throws correct exception}
  199     );
  200     lives_and(                                                                  # TIVAVRV34
  201         sub {
  202             is( integer_arrayref_typetest0( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
  203                 '[ 2, 2_112, 42, 23, -877, -33, 1_701 ]' . $mode_tagline,
  204                 q{TIVAVRV34 integer_arrayref_typetest0([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) returns correct value}
  205             );
  206         },
  207         q{TIVAVRV34 integer_arrayref_typetest0([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) lives}
  208     );
  209     lives_and(                                                                  # TIVAVRV40
  210         sub {
  211             is_deeply( integer_arrayref_typetest1(5), [ 0, 5, 10, 15, 20 ], q{TIVAVRV40 integer_arrayref_typetest1(5) returns correct value} );
  212         },
  213         q{TIVAVRV40 integer_arrayref_typetest1(5) lives}
  214     );
  215 
  216     # [[[ NUMBER ARRAY TESTS ]]]
  217     # [[[ NUMBER ARRAY TESTS ]]]
  218     # [[[ NUMBER ARRAY TESTS ]]]
  219 
  220     throws_ok(    # TNVAVRV00
  221         sub { number_arrayref_to_string() },
  222         "/(ENVAVRV00.*$mode_tagline)|(Usage.*number_arrayref_to_string)/",    # DEV NOTE: 2 different error messages, RPerl & C
  223         q{TNVAVRV00 number_arrayref_to_string() throws correct exception}
  224     );
  225     throws_ok(                                                                # TNVAVRV01
  226         sub { number_arrayref_to_string(undef) },
  227         "/ENVAVRV00.*$mode_tagline/",
  228         q{TNVAVRV01 number_arrayref_to_string(undef) throws correct exception}
  229     );
  230     throws_ok(                                                                # TNVAVRV02
  231         sub { number_arrayref_to_string(2) },
  232         "/ENVAVRV01.*$mode_tagline/",
  233         q{TNVAVRV02 number_arrayref_to_string(2) throws correct exception}
  234     );
  235     throws_ok(                                                                # TNVAVRV03
  236         sub { number_arrayref_to_string(2.3) },
  237         "/ENVAVRV01.*$mode_tagline/",
  238         q{TNVAVRV03 number_arrayref_to_string(2.3) throws correct exception}
  239     );
  240     throws_ok(                                                                # TNVAVRV04
  241         sub { number_arrayref_to_string('2') },
  242         "/ENVAVRV01.*$mode_tagline/",
  243         q{TNVAVRV04 number_arrayref_to_string('2') throws correct exception}
  244     );
  245     throws_ok(                                                                # TNVAVRV05
  246         sub { number_arrayref_to_string( { a_key => 23 } ) },
  247         "/ENVAVRV01.*$mode_tagline/",
  248         q{TNVAVRV05 number_arrayref_to_string({a_key => 23}) throws correct exception}
  249     );
  250     throws_ok(                                                                # TNVAVRV10
  251         sub {
  252             number_arrayref_to_string( [ 2, 2_112, undef, 23, -877, -33, 1_701 ] );
  253         },
  254         "/ENVAVRV02.*$mode_tagline/",
  255         q{TNVAVRV10 number_arrayref_to_string([ 2, 2_112, undef, 23, -877, -33, 1_701 ]) throws correct exception}
  256     );
  257     throws_ok(                                                                # TNVAVRV11
  258         sub {
  259             number_arrayref_to_string( [ 2, 2_112, 42, '23', -877, -33, 1_701 ] );
  260         },
  261         "/ENVAVRV03.*$mode_tagline/",
  262         q{TNVAVRV11 number_arrayref_to_string([ 2, 2_112, 42, '23', -877, -33, 1_701 ]) throws correct exception}
  263     );
  264     throws_ok(                                                                # TNVAVRV12
  265         sub {
  266             number_arrayref_to_string( [ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ] );
  267         },
  268         "/ENVAVRV03.*$mode_tagline/",
  269         q{TNVAVRV12 number_arrayref_to_string([ 2, 2_112, 42, [ 23 ], -877, -33, 1_701 ]) throws correct exception}
  270     );
  271     throws_ok(                                                                # TNVAVRV13
  272         sub {
  273             number_arrayref_to_string( [ 2, 2_112, 42, { a_subkey => 23 }, -877, -33, 1_701 ] );
  274         },
  275         "/ENVAVRV03.*$mode_tagline/",
  276         q{TNVAVRV13 number_arrayref_to_string([ 2, 2_112, 42, {a_subkey => 23}, -877, -33, 1_701 ]) throws correct exception}
  277     );
  278     lives_and(                                                                # TNVAVRV20
  279         sub {
  280             is( number_arrayref_to_string( [ 23 ] ), '[ 23 ]', q{TNVAVRV20 number_arrayref_to_string([ 23 ]) returns correct value} );
  281         },
  282         q{TNVAVRV20 number_arrayref_to_string([ 23 ]) lives}
  283     );
  284     lives_and(                                                                # TNVAVRV21
  285         sub {
  286             is( number_arrayref_to_string( [ 2, 2_112, 42, 23, -877, -33, 1_701 ] ),
  287                 '[ 2, 2_112, 42, 23, -877, -33, 1_701 ]',
  288                 q{TNVAVRV21 number_arrayref_to_string([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) returns correct value}
  289             );
  290         },
  291         q{TNVAVRV21 number_arrayref_to_string([ 2, 2_112, 42, 23, -877, -33, 1_701 ]) lives}
  292     );
  293     lives_and(                                                                # TNVAVRV22
  294         sub {
  295             is( number_arrayref_to_string( [ 23.2 ] ), '[ 23.2 ]', q{TNVAVRV22 number_arrayref_to_string([ 23.2 ]) returns correct value} );
  296         },
  297         q{TNVAVRV22 number_arrayref_to_string([ 23.2 ]) lives}
  298     );
  299     lives_and(                                                                # TNVAVRV23
  300         sub {
  301             is( number_arrayref_to_string( [ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ] ),
  302                 '[ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]',
  303                 q{TNVAVRV23 number_arrayref_to_string([ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]) returns correct value}
  304             );
  305         },
  306         q{TNVAVRV23 number_arrayref_to_string([ 2.1, 2_112.2, 42.3, 23, -877, -33, 1_701 ]) lives}
  307     );
  308 
  309     # NEED DELETE OLD CODE
  310 #    lives_and(                                                                # TNVAVRV24
  311 #        sub {
  312 #            is( 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 ] ),
  313 #                '[ 2.123_443_211_234_43, 2_112.432_1, 42.456_7, 23.765_444_444_444_4, -877.567_8, -33.876_587_658_765_9, 1_701.678_9 ]',
  314 #                q{TNVAVRV24 number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value}
  315 #            );
  316 #        },
  317 #        q{TNVAVRV24 number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
  318 #    );
  319 
  320     lives_and(                                                                 # TNVAVRV24
  321         sub {
  322             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 ] );
  323             like(
  324                 $tmp_retval,
  325                 qr/\[ 2\.123_443_211/,
  326                 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}
  327             );
  328             like(
  329                 $tmp_retval,
  330                 qr/, 1_701\.678_9 \]/,
  331                 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}
  332             );
  333         },
  334         q{TNVAVRV24 number_arrayref_to_string([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
  335     );
  336 
  337     throws_ok(                                                                # TNVAVRV30
  338         sub { number_arrayref_typetest0() },
  339         "/(ENVAVRV00.*$mode_tagline)|(Usage.*number_arrayref_typetest0)/",    # DEV NOTE: 2 different error messages, RPerl & C
  340         q{TNVAVRV30 number_arrayref_typetest0() throws correct exception}
  341     );
  342     throws_ok(                                                                 # TNVAVRV31
  343         sub { number_arrayref_typetest0(2) },
  344         "/ENVAVRV01.*$mode_tagline/",
  345         q{TNVAVRV31 number_arrayref_typetest0(2) throws correct exception}
  346     );
  347     throws_ok(                                                                 # TNVAVRV32
  348         sub {
  349             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 ] );
  350         },
  351         "/ENVAVRV02.*$mode_tagline/",
  352         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}
  353     );
  354     throws_ok(                                                                 # TNVAVRV33
  355         sub {
  356             number_arrayref_typetest0(
  357                 [ 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 ] );
  358         },
  359         "/ENVAVRV03.*$mode_tagline/",
  360         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}
  361     );
  362     
  363     # NEED DELETE OLD CODE
  364 #    lives_and(                                                                 # TNVAVRV34
  365 #        sub {
  366 #            is( 
  367 #                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 ] ),
  368 #                '[ 2.123_443_211_234_43, 2_112.432_1, 42.456_7, 23.765_444_444_444_4, -877.567_8, -33.876_587_658_765_9, 1_701.678_9 ]' . $mode_tagline,
  369 #                q{TNVAVRV34 number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) returns correct value}
  370 #            );
  371 #        },
  372 #        q{TNVAVRV34 number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
  373 #    );
  374     lives_and(                                                                 # TNVAVRV34
  375         sub {
  376             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 ] );
  377             like(
  378                 $tmp_retval,
  379                 qr/\[ 2\.123_443_211/,
  380                 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}
  381             );
  382             like(
  383                 $tmp_retval,
  384                 qr/, 1_701\.678_9 \]/,
  385                 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}
  386             );
  387             like(
  388                 $tmp_retval,
  389                 qr/$mode_tagline/,
  390                 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}
  391             );
  392         },
  393         q{TNVAVRV34 number_arrayref_typetest0([ 2.123_443_211_234_432_1, 2_112.432_1, ..., 1_701.678_9 ]) lives}
  394     );
  395 
  396     lives_and(                                                                 # TNVAVRV40
  397         sub {
  398             # NEED DELETE OLD CODE
  399 #            is_deeply(
  400             delta_ok(
  401                 number_arrayref_typetest1(5),
  402                 [ 0, 5.123456789, 10.246913578, 15.370370367, 20.493827156 ]
  403                 ,                                                              ## PERLTIDY BUG comma on newline
  404                 q{TNVAVRV40 number_arrayref_typetest1(5) returns correct value}
  405             );
  406         },
  407         q{TNVAVRV40 number_arrayref_typetest1(5) lives}
  408     );
  409 
  410     # [[[ STRING ARRAY TESTS ]]]
  411     # [[[ STRING ARRAY TESTS ]]]
  412     # [[[ STRING ARRAY TESTS ]]]
  413 
  414     throws_ok(    # TPVAVRV00
  415         sub { string_arrayref_to_string() },
  416         "/(EPVAVRV00.*$mode_tagline)|(Usage.*string_arrayref_to_string)/",    # DEV NOTE: 2 different error messages, RPerl & C
  417         q{TPVAVRV00 string_arrayref_to_string() throws correct exception}
  418     );
  419     throws_ok(                                                                # TPVAVRV01
  420         sub { string_arrayref_to_string(undef) },
  421         "/EPVAVRV00.*$mode_tagline/",
  422         q{TPVAVRV01 string_arrayref_to_string(undef) throws correct exception}
  423     );
  424     throws_ok(                                                                # TPVAVRV02
  425         sub { string_arrayref_to_string(2) },
  426         "/EPVAVRV01.*$mode_tagline/",
  427         q{TPVAVRV02 string_arrayref_to_string(2) throws correct exception}
  428     );
  429     throws_ok(                                                                # TPVAVRV03
  430         sub { string_arrayref_to_string(2.3) },
  431         "/EPVAVRV01.*$mode_tagline/",
  432         q{TPVAVRV03 string_arrayref_to_string(2.3) throws correct exception}
  433     );
  434     throws_ok(                                                                # TPVAVRV04
  435         sub { string_arrayref_to_string('Lone Ranger') },
  436         "/EPVAVRV01.*$mode_tagline/",
  437         q{TPVAVRV04 string_arrayref_to_string('Lone Ranger') throws correct exception}
  438     );
  439     throws_ok(                                                                # TPVAVRV05
  440         sub { string_arrayref_to_string( { a_key => 'Lone Ranger' } ) },
  441         "/EPVAVRV01.*$mode_tagline/",
  442         q{TPVAVRV05 string_arrayref_to_string({a_key => 'Lone Ranger'}) throws correct exception}
  443     );
  444     throws_ok(                                                                # TPVAVRV10
  445         sub {
  446             string_arrayref_to_string( [ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  447         },
  448         "/EPVAVRV02.*$mode_tagline/",
  449         q{TPVAVRV10 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
  450     );
  451     throws_ok(                                                                # TPVAVRV11
  452         sub {
  453             string_arrayref_to_string( [ 'Superman', 'Batman', 23, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  454         },
  455         "/EPVAVRV03.*$mode_tagline/",
  456         q{TPVAVRV11 string_arrayref_to_string([ 'Superman', 'Batman', 23, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
  457     );
  458     throws_ok(                                                                # TPVAVRV12
  459         sub {
  460             string_arrayref_to_string( [ 'Superman', 'Batman', 23.2, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  461         },
  462         "/EPVAVRV03.*$mode_tagline/",
  463         q{TPVAVRV12 string_arrayref_to_string([ 'Superman', 'Batman', 23.2, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
  464     );
  465     throws_ok(                                                                # TPVAVRV13
  466         sub {
  467             string_arrayref_to_string( [ 'Superman', 'Batman', ['Wonder Woman'], 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  468         },
  469         "/EPVAVRV03.*$mode_tagline/",
  470         q{TPVAVRV13 string_arrayref_to_string([ 'Superman', 'Batman', ['Wonder Woman'], 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
  471     );
  472     throws_ok(                                                                # TPVAVRV14
  473         sub {
  474             string_arrayref_to_string( [ 'Superman', 'Batman', { a_subkey => 'Wonder Woman' }, 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  475         },
  476         "/EPVAVRV03.*$mode_tagline/",
  477         q{TPVAVRV14 string_arrayref_to_string([ 'Superman', 'Batman', {a_subkey => 'Wonder Woman'}, ..., 'Martian Manhunter' ]) throws correct exception}
  478     );
  479     lives_and(                                                                # TPVAVRV20
  480         sub {
  481             is( string_arrayref_to_string(
  482                     [ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]
  483                 ),
  484                 q{[ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]},
  485                 q{TPVAVRV20 string_arrayref_to_string([ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ]) returns correct value}
  486             );
  487         },
  488         q{TPVAVRV20 string_arrayref_to_string([ 'Howard The Duck', 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter' ]) lives}
  489     );
  490     lives_and(                                                                # TPVAVRV21
  491         sub {
  492             is( string_arrayref_to_string( [ 'Superman', 'Martian Manhunter', 'undef' ] ),
  493                 q{[ 'Superman', 'Martian Manhunter', 'undef' ]},
  494                 q{TPVAVRV21 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', 'undef' ]) returns correct value}
  495             );
  496         },
  497         q{TPVAVRV21 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', 'undef' ]) lives}
  498     );
  499     lives_and(                                                                # TPVAVRV22
  500         sub {
  501             is( string_arrayref_to_string( [ 'Superman', 'Martian Manhunter', '23' ] ),
  502                 q{[ 'Superman', 'Martian Manhunter', '23' ]},
  503                 q{TPVAVRV22 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '23' ]) returns correct value}
  504             );
  505         },
  506         q{TPVAVRV22 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '23' ]) lives}
  507     );
  508     lives_and(                                                                # TPVAVRV23
  509         sub {
  510             is( string_arrayref_to_string( [ 'Superman', 'Martian Manhunter', '-2_112.23' ] ),
  511                 q{[ 'Superman', 'Martian Manhunter', '-2_112.23' ]},
  512                 q{TPVAVRV23 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '-2_112.23' ]) returns correct value}
  513             );
  514         },
  515         q{TPVAVRV23 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter', '-2_112.23' ]) lives}
  516     );
  517     lives_and(                                                                # TPVAVRV24
  518         sub {
  519             is( string_arrayref_to_string( [ 'Superman', 'Martian Manhunter', "[\\'Tonto'\\]" ] ),
  520                 q{[ 'Superman', 'Martian Manhunter', '[\\\\\'Tonto\'\\\\]' ]},
  521                 q{TPVAVRV24 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', "[\\'Tonto'\\]" ]) returns correct value}
  522             );
  523         },
  524         q{TPVAVRV24 string_arrayref_to_string([ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', "Martian Manhunter", "-2_112.23" ]) lives}
  525     );
  526     lives_and(                                                                # TPVAVRV25
  527         sub {
  528             is( string_arrayref_to_string( [ 'Superman', 'Martian Manhunter', '{buzz => 5}' ] ),
  529                 q{[ 'Superman', 'Martian Manhunter', '{buzz => 5}' ]},
  530                 q{TPVAVRV25 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '{buzz => 5}' ]) returns correct value}
  531             );
  532         },
  533         q{TPVAVRV25 string_arrayref_to_string([ 'Superman', 'Martian Manhunter', '{buzz => 5}' ]) lives}
  534     );
  535     throws_ok(                                                                # TPVAVRV30
  536         sub { string_arrayref_typetest0() },
  537         "/(EPVAVRV00.*$mode_tagline)|(Usage.*string_arrayref_typetest0)/",    # DEV NOTE: 2 different error messages, RPerl & C
  538         q{TPVAVRV30 string_arrayref_typetest0() throws correct exception}
  539     );
  540     throws_ok(                                                                 # TPVAVRV31
  541         sub { string_arrayref_typetest0(2) },
  542         "/EPVAVRV01.*$mode_tagline/",
  543         q{TPVAVRV31 string_arrayref_typetest0(2) throws correct exception}
  544     );
  545     throws_ok(                                                                 # TPVAVRV32
  546         sub {
  547             string_arrayref_typetest0( [ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] );
  548         },
  549         "/EPVAVRV02.*$mode_tagline/",
  550         q{TPVAVRV32 string_arrayref_typetest0([ 'Superman', 'Batman', 'Wonder Woman', undef, 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) throws correct exception}
  551     );
  552     throws_ok(                                                                 # TPVAVRV33
  553         sub {
  554             string_arrayref_typetest0( [ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter', [ 23, -42.3 ] ] );
  555         },
  556         "/EPVAVRV03.*$mode_tagline/",
  557         q{TPVAVRV33 string_arrayref_typetest0([ 'Superman', 'Batman', 'Wonder Woman', ..., 'Martian Manhunter', [ 23, -42.3 ] ]) throws correct exception}
  558     );
  559     lives_and(                                                                 # TPVAVRV34
  560         sub {
  561             is( string_arrayref_typetest0( [ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ] ),
  562                 q{[ 'Superman', 'Batman', 'Wonder Woman', 'Flash', 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]} . $mode_tagline,
  563                 q{TPVAVRV34 string_arrayref_typetest0([ 'Superman', ..., 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) returns correct value}
  564             );
  565         },
  566         q{TPVAVRV34 string_arrayref_typetest0([ 'Superman', ..., 'Green Lantern', 'Aquaman', 'Martian Manhunter' ]) lives}
  567     );
  568     lives_and(                                                                 # TPVAVRV40
  569         sub {
  570             is_deeply(
  571                 string_arrayref_typetest1(5),
  572                 [   'Jeffy Ten! 0/4 ' . $mode_tagline,
  573                     'Jeffy Ten! 1/4 ' . $mode_tagline,
  574                     'Jeffy Ten! 2/4 ' . $mode_tagline,
  575                     'Jeffy Ten! 3/4 ' . $mode_tagline,
  576                     'Jeffy Ten! 4/4 ' . $mode_tagline,
  577                 ],
  578                 q{TPVAVRV40 string_arrayref_typetest1(5) returns correct value}
  579             );
  580         },
  581         q{TPVAVRV40 string_arrayref_typetest1(5) lives}
  582     );
  583 }
  584 
  585 done_testing();