From 86027f9b1b2558927825d203324d2288abec19de Mon Sep 17 00:00:00 2001 From: XxFran10xX <318299142+XxFran10xX@users.noreply.github.com> Date: Fri, 6 Nov 2026 17:10:05 +0100 Subject: [PATCH] test: a random director id starting with the typed digit no longer fails the camps completion test The ruin camps completion also offers the camp director's character id, which the test generates at random; when it started with 2 the assertion for "camps 2" failed (about 1 run in 16, twice on 11-06). Co-Authored-By: Claude Opus 5.5 --- .../net/tfminecraft/archaeo/command/ArchaeoCommandTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/tfminecraft/archaeo/command/ArchaeoCommandTest.java b/src/test/java/net/tfminecraft/archaeo/command/ArchaeoCommandTest.java index 9aeb1e0..7dd5e82 100644 --- a/src/test/java/net/tfminecraft/archaeo/command/ArchaeoCommandTest.java +++ b/src/test/java/net/tfminecraft/archaeo/command/ArchaeoCommandTest.java @@ -568,7 +568,9 @@ public void consoleCommandsExplainWorldRequirementsAndCanGiveToNamedPlayers() { assertTrue(complete("ruin", "info", "z").isEmpty()); assertEquals(List.of("ruin"), complete("ruin", "info", "Old", "r")); assertEquals(java.util.Set.of("#1", "#2"), new java.util.HashSet<>(complete("ruin", "tp", "#"))); - assertEquals(List.of("#2"), complete("ruin", "camps", "2")); + // The director's character id is random and is offered too when it starts with the typed digit. + assertEquals(List.of("#2"), complete("ruin", "camps", "2").stream().filter(choice -> choice.startsWith("#")).toList()); + assertTrue(complete("ruin", "camps", "2").stream().allMatch(choice -> choice.equals("#2") || choice.startsWith("2"))); assertTrue(complete("ruin", "camps", "z").isEmpty()); assertEquals(List.of("#2"), complete("ruin", "camps", "Archaeologist", "#")); assertTrue(complete("ruin", "camps", "Archaeologist", "9").isEmpty());