File: is

package info (click to toggle)
libtest-inter-perl 1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: perl: 1,776; sh: 22; makefile: 6
file content (20 lines) | stat: -rwxr-xr-x 597 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl

use Test::Inter;
$o = new Test::Inter;

print "The following tests should all succeed\n\n";

$o->is  ( [ a,b ], [ a,b ], "List test" );
$o->isnt( [ a,b ], [ a,c ], "List test" );

$o->is  ( { a => 1, b => 2 }, { a => 1, b => 2 }, "Hash test" );
$o->isnt( { a => 1, b => 2 }, { a => 1, b => 3 }, "Hash test" );

print "\nThe following tests should all fail\n\n";

$o->isnt( [ a,b ], [ a,b ], "List test" );
$o->is  ( [ a,b ], [ a,c ], "List test" );

$o->isnt( { a => 1, b => 2 }, { a => 1, b => 2 }, "Hash test" );
$o->is  ( { a => 1, b => 2 }, { a => 1, b => 3 }, "Hash test" );