diff options
Diffstat (limited to 'ext/hash/tests/joaat.phpt')
-rw-r--r-- | ext/hash/tests/joaat.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/hash/tests/joaat.phpt b/ext/hash/tests/joaat.phpt new file mode 100644 index 000000000..fa310a96e --- /dev/null +++ b/ext/hash/tests/joaat.phpt @@ -0,0 +1,34 @@ +--TEST-- +Jenkins's one-at-a-time +--SKIPIF-- +<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +--FILE-- +<?php +$tests = array( + array("hello world", "3e4a5a57"), + array("", 0), + array("", "000000"), + array("a", "ca2e9442"), + array("aa", "7081738e"), +); + +$i = 0; +$pass = true; + +foreach ($tests as $test) { + ++$i; + + $result = hash("joaat", $test[0]); + if ($result != $test[1]) { + echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n"; + + $pass = false; + } +} + +if($pass) { + echo "PASS"; +} +?> +--EXPECT-- +PASS |