Skip to content

Commit 70a973b

Browse files
test(recommendations): exercise the 120-identifier limit
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent ea34c67 commit 70a973b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎tests/Unit/RecommendationsTest.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,12 @@ function recommendation_sample(array $override = []): array {
348348
});
349349

350350
it('limits how many candidate identifiers one message can produce', function () {
351-
$message = implode(' ', array_map(static fn ($n) => 'Word' . $n, range(1, 100)));
351+
$message = implode(' ', array_map(static fn ($n) => 'Word' . $n, range(1, 121)));
352352

353-
expect(syslog_recommendation_candidates($message))->toHaveCount(120);
353+
$candidates = syslog_recommendation_candidates($message);
354+
expect($candidates)->toHaveCount(120)
355+
->and($candidates[119])->toBe('Word120')
356+
->and($candidates)->not->toContain('Word121');
354357
});
355358

356359
it('remembers the bundled seed was applied', function () {

0 commit comments

Comments
 (0)