diff options
author | Brian Cully <bjc@kublai.com> | 2017-10-30 15:34:21 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2017-10-30 15:34:21 -0400 |
commit | 0964736afe66c066f8b77a54d77f27bdb8d24cd5 (patch) | |
tree | 5a39219a8f745b0a3b374e25d86c00bbde10fc77 /t | |
parent | f887806c5989fc3e5c86107d6ff945a6fc63b05c (diff) | |
download | spamcat-0964736afe66c066f8b77a54d77f27bdb8d24cd5.tar.gz spamcat-0964736afe66c066f8b77a54d77f27bdb8d24cd5.zip |
Add get and set commands for tweaking counts.
Introduce 'get' to query a count for a given email address, and 'set'
to manually update it.
Diffstat (limited to 't')
-rw-r--r-- | t/lib.t | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,6 +1,6 @@ # -*- Mode: cperl -*- -use Test::More tests => 41; +use Test::More tests => 42; use strict; use warnings; @@ -39,7 +39,8 @@ ok(!defined $sch->get_count('doesntexist'), 'Non-existant sender has undefined count'); ok(SpamCat->can('set_count'), 'Has count setter'); -is($sch->set_count('bar', 1), 1, 'Setting count returns existing count'); +is($sch->set_count('bar', 10), 10, 'Setting count returns existing count'); +is($sch->set_count('bar', 1), 1, 'Updating existing count to 1 returns 1'); is($sch->decrement_count('bar'), 0, 'Decrementing count from 1 returns 0'); is($sch->decrement_count('bar'), 0, 'Decrementing count from 0 returns 0'); |