File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
tests/Predis/Cluster/Hash Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the Predis package.
5+ *
6+ * (c) Daniele Alessandri <[email protected] > 7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ namespace Predis \Cluster \Hash ;
13+
14+ use PredisTestCase ;
15+
16+ /**
17+ *
18+ */
19+ class CRC16Test extends PredisTestCase
20+ {
21+ /**
22+ * @group disconnected
23+ */
24+ public function testHashGeneration ()
25+ {
26+ $ crc16 = new CRC16 ();
27+
28+ $ this ->assertSame (58359 , $ crc16 ->hash ('key:000 ' ));
29+ $ this ->assertSame (62422 , $ crc16 ->hash ('key:001 ' ));
30+ $ this ->assertSame (50101 , $ crc16 ->hash ('key:002 ' ));
31+ $ this ->assertSame (54164 , $ crc16 ->hash ('key:003 ' ));
32+ $ this ->assertSame (41843 , $ crc16 ->hash ('key:004 ' ));
33+ $ this ->assertSame (45906 , $ crc16 ->hash ('key:005 ' ));
34+ $ this ->assertSame (33585 , $ crc16 ->hash ('key:006 ' ));
35+ $ this ->assertSame (37648 , $ crc16 ->hash ('key:007 ' ));
36+ $ this ->assertSame (25343 , $ crc16 ->hash ('key:008 ' ));
37+ $ this ->assertSame (29406 , $ crc16 ->hash ('key:009 ' ));
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments