forked from derickr/quickhash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
int-set-getsize.phpt
48 lines (41 loc) · 910 Bytes
/
int-set-getsize.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--TEST--
Test for getSize().
--INI--
xdebug.default_enable=0
--FILE--
<?php
$set = new QuickHashIntSet( 1024 );
var_dump( $set->getSize() );
$set->add( 4 );
$set->add( 4 );
var_dump( $set->getSize() );
$file = dirname( __FILE__ ) . "/primes.set";
$set = QuickHashIntSet::loadFromFile( $file );
var_dump( $set->getSize() );
$set->delete( 5 );
var_dump( $set->getSize() );
$set->delete( 9 );
var_dump( $set->getSize() );
$set->add( 9 );
var_dump( $set->getSize() );
$set->add( 9 );
var_dump( $set->getSize() );
// Now we check with dupe checking enabled.
$file = dirname( __FILE__ ) . "/primes.set";
$set = QuickHashIntSet::loadFromFile( $file, null, QuickHashIntSet::CHECK_FOR_DUPES );
var_dump( $set->getSize() );
$set->add( 5 );
$set->add( 9 );
$set->add( 9 );
var_dump( $set->getSize() );
?>
--EXPECT--
int(0)
int(2)
int(100008)
int(100007)
int(100007)
int(100008)
int(100009)
int(100008)
int(100009)