xref: /PHP-7.3/ext/hash/tests/joaat.phpt (revision 782352c5)
1--TEST--
2Jenkins's one-at-a-time
3--SKIPIF--
4<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
5--FILE--
6<?php
7$tests = array(
8	array("hello world", "3e4a5a57"),
9	array("", 0),
10	array("", "000000"),
11	array("a", "ca2e9442"),
12	array("aa", "7081738e"),
13);
14
15$i = 0;
16$pass = true;
17
18foreach ($tests as $test) {
19	++$i;
20
21	$result = hash("joaat", $test[0]);
22	if ($result != $test[1]) {
23		echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
24
25		$pass = false;
26	}
27}
28
29if($pass) {
30    echo "PASS";
31}
32?>
33--EXPECT--
34PASS
35