29 $this->assertEquals( 0, $set->getSize() );
31 $this->assertEquals( 3, $set->getWorstScore() );
32 $this->assertEquals( 3, $set->getBestScore() );
35 $set->append( $suggestion );
36 $this->assertEquals( 2, $set->getWorstScore() );
37 $this->assertEquals( 3, $set->getBestScore() );
38 $this->assertEquals( 2, $suggestion->getScore() );
41 $set->append( $suggestion );
42 $this->assertEquals( 1, $set->getWorstScore() );
43 $this->assertEquals( 3, $set->getBestScore() );
44 $this->assertEquals( 1, $suggestion->getScore() );
46 $scores = $set->map(
function (
$s ) {
47 return $s->getScore();
51 $this->assertEquals( $sorted, $scores );
60 $this->assertEquals( 0, $set->getSize() );
62 $this->assertEquals( 3, $set->getWorstScore() );
63 $this->assertEquals( 3, $set->getBestScore() );
66 $set->prepend( $suggestion );
67 $this->assertEquals( 3, $set->getWorstScore() );
68 $this->assertEquals( 4, $set->getBestScore() );
69 $this->assertEquals( 4, $suggestion->getScore() );
72 $set->prepend( $suggestion );
73 $this->assertEquals( 3, $set->getWorstScore() );
74 $this->assertEquals( 5, $set->getBestScore() );
75 $this->assertEquals( 5, $suggestion->getScore() );
78 $set->prepend( $suggestion );
79 $this->assertEquals( 3, $set->getWorstScore() );
80 $this->assertEquals( 6, $set->getBestScore() );
81 $this->assertEquals( 6, $suggestion->getScore() );
83 $scores = $set->map(
function (
$s ) {
84 return $s->getScore();
88 $this->assertEquals( $sorted, $scores );
93 for ( $i = 0; $i < 100; $i++ ) {
97 $this->assertEquals( 10, $set->getSize() );
100 $this->assertEquals( 0, $set->getSize() );