File: 004_testset.t

package info (click to toggle)
libsereal-decoder-perl 5.004%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,556 kB
  • sloc: ansic: 11,615; perl: 6,938; sh: 25; makefile: 9
file content (37 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
#!perl
use strict;
use warnings;
use Data::Dumper;
use File::Spec;

# test our test framework

use lib File::Spec->catdir(qw(t lib));

BEGIN {
    lib->import('lib')
        if !-d 't';
}

use Sereal::TestSet qw(:all);
use Test::More;

# needs more tests
ok( _test_deep_cmp( ["x"], {} ) );
ok( _test_deep_cmp( { "x" => 1 }, { "y" => 1 } ) );
ok( _test_deep_cmp( { "x" => 1 }, { "x" => 2 } ) );
ok( _test_deep_cmp( { "x" => 1 }, { "x" => 2, "y" => 1 } ) );
ok( !_test_deep_cmp( { "x" => 1 }, { "x" => 1 } ) );
ok( !_test_deep_cmp( ["x"], ["x"] ) );
ok( _test_deep_cmp( ["x"], [ "y", "p" ] ) );
ok( _test_deep_cmp( [ "a", "x" ], ["y"] ) );
ok( _cmp_str( "foo", "bar" ) );
ok( !_cmp_str( "aaa", "aaa" ) );
ok( _cmp_str( "aaacowbbb", "aaadogbb" ) );
my $l= "ba\xDF";
my $u= $l;
utf8::upgrade($u);
ok( _cmp_str( $l, $u ) );
pass();
done_testing();