X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FAlgorithm-BIT-XS.t;h=c2ee47a3cee96a3c35df85d77af74a37722d69ae;hb=0c7cf8e9cf7b3714bc5fc9e2625d6e4016b8812a;hp=c6ce19f40cae5e9d012131cc752a85c415a1a0c2;hpb=0e4f70024573e1a6be0c53b0c51474eb1d975d43;p=algorithm-bit-xs.git diff --git a/t/Algorithm-BIT-XS.t b/t/Algorithm-BIT-XS.t index c6ce19f..c2ee47a 100644 --- a/t/Algorithm-BIT-XS.t +++ b/t/Algorithm-BIT-XS.t @@ -2,8 +2,9 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 17; BEGIN { use_ok('Algorithm::BIT::XS') }; +BEGIN { use_ok('Algorithm::BIT2D::XS') }; my $bit = Algorithm::BIT::XS->new(100); is $bit->query(5), 0; @@ -29,3 +30,11 @@ $bit->clear; $bit->set(16,10); is $bit->query(15), 0; is $bit->query(16), 10; + + +my $bit2d = Algorithm::BIT2D::XS->new(100, 50); +is $bit2d->query(5, 5), 0; +$bit2d->update(4, 4, 2); +$bit2d->update(5, 1, 3); +is $bit2d->query(5, 5), 5; +is $bit2d->query(5, 2), 3;