From 64f760c1483ad1b34c79557faa5fc27c2d86103d Mon Sep 17 00:00:00 2001 From: Christian Helbling Date: Mon, 23 May 2016 17:27:25 +0200 Subject: add it::mod which returns modulo as a positive number --- tests/it.t | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/it.t b/tests/it.t index 4fd848b..3688d2a 100755 --- a/tests/it.t +++ b/tests/it.t @@ -410,3 +410,8 @@ foreach (array($dummy, false, true, null, 1, "a", "Ä", "/", array()) as $var) is(it::sort(array("2!","19!","1!")), array("1!", "19!", "2!")); is(it::sort(array("2!","19!","1!"), "r"), array("2!", "19!", "1!")); is(it::sort(array("2!","19!","1!"), "rn"), array("19!", "2!", "1!")); + +is(it::mod(-9, 4), 3); +is(it::mod(-8, 4), 0); +is(it::mod(0, 4), 0); +is(it::mod(7, 4), 3); -- cgit v1.2.3