Annotation of embedaddon/php/ext/standard/tests/strings/strnatcasecmp_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strnatcasecmp() function : basic functionality
3: --CREDITS--
4: Felix De Vliegher <felix.devliegher@gmail.com>
5: --FILE--
6: <?php
7: /* Prototype : int strnatcasecmp(string s1, string s2)
8: * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
9: * Source code: ext/standard/string.c
10: * Alias to functions:
11: */
12:
13: function str_dump($one, $two) {
14: var_dump(strnatcasecmp($one, $two));
15: }
16:
17: echo "*** Testing strnatcasecmp() : basic functionality ***\n";
18:
19: // Calling strnatcasecmp() with all possible arguments
20: str_dump('A', 'a');
21: str_dump('a10', 'A20');
22: str_dump('A1b', 'a');
23: str_dump('x2-y7', 'x8-y8');
24: str_dump('1.010', '1.001');
25: str_dump(' ab', ' aB');
26: str_dump('acc ', 'acc');
27: str_dump(11.5, 10.5);
28: str_dump(10.5, 10.5E1);
29: str_dump('Rfc822.txt', 'rfc2086.txt');
30: str_dump('Rfc822.txt', 'rfc822.TXT');
31: str_dump('pIc 6', 'pic 7');
32: str_dump(0xFFF, 0Xfff);
33:
34: ?>
35: ===DONE===
36: --EXPECT--
37: *** Testing strnatcasecmp() : basic functionality ***
38: int(0)
39: int(-1)
40: int(1)
41: int(-1)
42: int(1)
43: int(0)
44: int(1)
45: int(1)
46: int(-1)
47: int(-1)
48: int(0)
49: int(-1)
50: int(0)
51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>