30 $this->assertEquals( 0, $set->getSize() );
32 $this->assertEquals( 3, $set->getWorstScore() );
33 $this->assertEquals( 3, $set->getBestScore() );
36 $set->append( $suggestion );
37 $this->assertEquals( 2, $set->getWorstScore() );
38 $this->assertEquals( 3, $set->getBestScore() );
39 $this->assertEquals( 2, $suggestion->getScore() );
42 $set->append( $suggestion );
43 $this->assertEquals( 1, $set->getWorstScore() );
44 $this->assertEquals( 3, $set->getBestScore() );
45 $this->assertEquals( 1, $suggestion->getScore() );
47 $scores = $set->map(
function (
$s ) {
48 return $s->getScore();
52 $this->assertEquals( $sorted, $scores );
64 $this->assertEquals( 0, $set->getSize() );
66 $this->assertEquals( 3, $set->getWorstScore() );
67 $this->assertEquals( 3, $set->getBestScore() );
70 $set->prepend( $suggestion );
71 $this->assertEquals( 3, $set->getWorstScore() );
72 $this->assertEquals( 4, $set->getBestScore() );
73 $this->assertEquals( 4, $suggestion->getScore() );
76 $set->prepend( $suggestion );
77 $this->assertEquals( 3, $set->getWorstScore() );
78 $this->assertEquals( 5, $set->getBestScore() );
79 $this->assertEquals( 5, $suggestion->getScore() );
82 $set->prepend( $suggestion );
83 $this->assertEquals( 3, $set->getWorstScore() );
84 $this->assertEquals( 6, $set->getBestScore() );
85 $this->assertEquals( 6, $suggestion->getScore() );
87 $scores = $set->map(
function (
$s ) {
88 return $s->getScore();
92 $this->assertEquals( $sorted, $scores );
100 for ( $i = 0; $i < 100; $i++ ) {
104 $this->assertEquals( 10, $set->getSize() );
107 $this->assertEquals( 0, $set->getSize() );