Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Test::JSON 0.11

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Curtis Poe | More programs
    Perl Artistic License / FREE
    July 28th, 2008, 13:42 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Test::JSON description

    A Perl module that contains test JSON data.

    Test::JSON is a Perl module that contains test JSON data.

    SYNOPSIS

    use Test::JSON;

    is_valid_json $json, '... json is well formed';
    is_json $json, $expected_json, '... and it matches what we expected';


    JavaScript Object Notation (JSON) is a lightweight data interchange format. Test::JSON makes it easy to verify that you have built valid JSON and that it matches your expected output.

    TESTS

    is_valid_json

    is_valid_json $json, '... json is well formed';

    Test passes if the string passed is valid JSON.
    is_json

    is_json $json, $expected_json, '... and it matches what we expected';


    Test passes if the two JSON strings are valid JSON and evaluate to the same data structure.

    Test::Differences is used to provide easy diagnostics of why the JSON structures did not match. For example:

    Failed test '... and identical JSON should match'
    in t/10testjson.t at line 14.

    +----+---------------------------+---------------------------+
    | Elt|Got |Expected |
    +----+---------------------------+---------------------------+
    | 0|{ |{ |
    | 1| bool => '1', | bool => '1', |
    | 2| description => bless( { | description => bless( { |
    | 3| value => undef | value => undef |
    | 4| }, 'JSON::NotString' ), | }, 'JSON::NotString' ), |
    | 5| id => '1', | id => '1', |
    * 6| name => 'foo' | name => 'fo' *
    | 7|} |} |
    +----+---------------------------+---------------------------+



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    JSON tests | JSON data | Perl module | JSON | tests | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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