File: 00-load.t

package info (click to toggle)
libjson-any-perl 1.28-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 252 kB
  • sloc: perl: 2,701; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!perl -T

use Test::More;

BEGIN {

    # Count who's installed
    my @order = qw(JSON::XS JSON JSON::DWIW JSON::Syck);
    my $count = scalar grep { eval "require $_"; not $@; } @order;

    unless ($count) {    # need at least one
        plan skip_all => "Can't find a JSON package.";
        exit;
    }

    # if we're here we have *something* that will work
    plan tests => 7;
    use_ok('JSON::Any');
}

diag("Testing JSON::Any $JSON::Any::VERSION, Perl $], $^X");
can_ok( JSON::Any, qw(new) );
can_ok( JSON::Any, qw(objToJson jsonToObj) );
can_ok( JSON::Any, qw(to_json from_json ) );
can_ok( JSON::Any, qw(Dump Load ) );
can_ok( JSON::Any, qw(encode decode ) );

is( JSON::Any->objToJson( { foo => 'bar' } ), q[{"foo":"bar"}] );