in reply to Re: Determine if a given DateTime is a member of a DateTime::Set
in thread Determine if a given DateTime is a member of a DateTime::Set
the "in-between" weeks properly fail.
No, the second call to Test::More::is:
is($biweekly->contains($date), 0, $date->ymd . ' is *NOT* the bi-weekl +y set');
succeeds only if the call to contains returns 0, i.e., if the DateTime::Set object $biweekly does not contain the specified date (which it shouldn’t). But the call to contains is actually (and incorrectly) returning 1, thereby indicating that the object does contain the given date. So, the test fails because the call to contains returns the wrong answer in this case.
To the OP: I’ve been playing with the code, but haven’t found any way of making it work correctly. So, either the module is buggy, or, at the least, it is poorly documented.
I did notice that you are calling the contains method with a scalar, whereas the module documentation says it takes a list. But putting the argument into an array and passing that to the function makes no difference to the result of the tests. :-(
|Athanasius <°(((>< contra mundum||Iustus alius egestas vitae, eros Piratica,|