Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    Test::Data::Scalar 1.22

    Download button

    No screenshots available
    Downloads: 428  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.3/5)
    8 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    brian d foy | More programs
    Perl Artistic License / FREE
    July 29th, 2008, 15:20 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Test::Data::Scalar description

    A Perl module with test functions for scalar variables.

    Test::Data::Scalar is a Perl module with test functions for scalar variables.

    SYNOPSIS

    use Test::Data qw(Scalar);

    This modules provides a collection of test utilities for scalar variables. Load the module through Test::Data.
    Functions

    blessed_ok( SCALAR )

    Ok if the SCALAR is a blessed reference.
    defined_ok( SCALAR )

    Ok if the SCALAR is defined.
    undef_ok( SCALAR )

    Ok if the SCALAR is undefined.
    dualvar_ok( SCALAR )

    Ok if the scalar is a dualvar.

    How do I test this?

    sub dualvar_ok ($;$) { my $ok = Scalar::Util::dualvar( $_[0] ); my $name = $_[1] || 'Scalar is a dualvar';

    $Test->ok( $ok, $name );

    $Test->diag("Expected a dualvar, didn't get itn")
    unless $ok;
    }

    greater_than( SCALAR, BOUND )

    Ok if the SCALAR is numerically greater than BOUND.
    length_ok( SCALAR, LENGTH )

    Ok if the length of SCALAR is LENGTH.
    less_than( SCALAR, BOUND )

    Ok if the SCALAR is numerically less than BOUND.
    maxlength_ok( SCALAR, LENGTH )

    Ok is the length of SCALAR is less than or equal to LENGTH.
    minlength_ok( SCALAR, LENGTH )

    Ok is the length of SCALAR is greater than or equal to LENGTH.
    number_ok( SCALAR )

    Ok if the SCALAR is a number ( or a string that represents a number ).

    At the moment, a number is just a string of digits. This needs work.
    number_between_ok( SCALAR, LOWER, UPPER )

    Ok if the number in SCALAR sorts between the number in LOWER and the number in UPPER, numerically.

    If you put something that isn't a number into UPPER or LOWER, Perl will try to make it into a number and you may get unexpected results.
    string_between_ok( SCALAR, LOWER, UPPER )

    Ok if the string in SCALAR sorts between the string in LOWER and the string in UPPER, ASCII-betically.
    readonly_ok( SCALAR )

    Ok is the SCALAR is read-only.
    ref_ok( SCALAR )

    Ok if the SCALAR is a reference.
    ref_type_ok( REF1, REF2 )

    Ok if REF1 is the same reference type as REF2.
    strong_ok( SCALAR )

    Ok is the SCALAR is not a weak reference.
    tainted_ok( SCALAR )

    Ok is the SCALAR is tainted.

    (Tainted values may seem like a not-Ok thing, but remember, when you use taint checking, you want Perl to taint data, so you should have a test to make sure it happens.)
    untainted_ok( SCALAR )

    Ok if the SCALAR is not tainted.
    weak_ok( SCALAR )

    Ok if the SCALAR is a weak reference.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    test functions | scalar variables | Perl module | test | functions | scalar



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM