File: overload.t

package info (click to toggle)
libdata-compare-perl 1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 264 kB
  • sloc: perl: 454; sh: 3; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;
use lib 't/lib';
use SpecialClass;

use Data::Compare;
use Test::More tests=>2;

ok(!Compare(SpecialClass->new(str=>'bar'),
            SpecialClass->new(str=>'bar',num=>15)),
   'String overload does not fool it');

ok(!Compare(SpecialClass->new(str=>'bar',num=>15),
            SpecialClass->new(str=>'boo',num=>15)),
   'Numeric overload does not fool it');