Skip to content

Commit fd3c713

Browse files
committed
one more StackSet test
1 parent a3baa4e commit fd3c713

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/StackQueue/StackSetTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,18 @@ public function testStackSet() {
1818
$this->assertTrue($element === "Hallo 3");
1919
$this->assertTrue($stackSet->stackCount() === 1);
2020
}
21+
22+
public function testHugeStackSet() {
23+
$setSize = 1024;
24+
$factor = 4;
25+
$stackSet = new StackSet(1024);
26+
for ($i = 0; $i < $setSize * $factor; $i++) {
27+
$stackSet->push($i);
28+
}
29+
$this->assertTrue($stackSet->stackCount() === $factor);
30+
for ($i = 0; $i < $setSize + 1; $i++) {
31+
$stackSet->pop();
32+
}
33+
$this->assertTrue($stackSet->stackCount() === 3);
34+
}
2135
}

0 commit comments

Comments
 (0)