From 0663ed4e594aafb1c56e871333d4435ec2108b10 Mon Sep 17 00:00:00 2001 From: Jonathan Lovelace Date: Fri, 29 Mar 2024 23:04:36 -0400 Subject: [PATCH] Fix tests broken by cbdf7412292566da6a43b6bf55d8243ce2053211 et seq. --- .../src/test/java/drivers/common/cli/CLITest.java | 12 ++++++------ .../exploration/old/TestExplorationRunner.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers.common/src/test/java/drivers/common/cli/CLITest.java b/drivers.common/src/test/java/drivers/common/cli/CLITest.java index cea5f259c..e7b6425c0 100644 --- a/drivers.common/src/test/java/drivers/common/cli/CLITest.java +++ b/drivers.common/src/test/java/drivers/common/cli/CLITest.java @@ -213,8 +213,8 @@ public void testInputBooleanSimpleFalse(final String arg) { @Test public void testInputBooleanInvalidInput() { assertCLI(cli -> cli.inputBoolean("prompt three "), Arrays.asList("yoo-hoo", "no"), - "prompt three Please enter \"yes\", \"no\", \"true\", or \"false\",%n" + - "or the first character of any of those.%nprompt three ".formatted(), false, + ("prompt three Please enter \"yes\", \"no\", \"true\", or \"false\",%n" + + "or the first character of any of those.%nprompt three ").formatted(), false, "inputBoolean rejects other input", "inputBoolean gives message on invalid input"); } @@ -249,10 +249,10 @@ public void testInputBooleanInSeriesSimpleFalse(final String arg) { @Test public void testInputBooleanInSeriesAll() { assertCLI(cli -> cli.inputBooleanInSeries("prompt three "), Arrays.asList("nothing", "true"), - "prompt three Please enter \"yes\", \"no\", \"true\", or \"false\", " + + ("prompt three Please enter \"yes\", \"no\", \"true\", or \"false\", " + "the first%ncharacter of any of those, or \"all\", \"none\", \"always\", " + "or%n\"never\" to use the same answer for all further questions.%nprompt " + - "three ".formatted(), + "three ").formatted(), true, "inputBoolean rejects other input", "inputBoolean gives message on invalid input"); final StringBuilder ostream = new StringBuilder(); @@ -342,8 +342,8 @@ public void testInputBooleanInSeriesSeparateKeys() { "inputBooleanInSeries then honors yes-to-all"); assertEquals(false, cli.inputBooleanInSeries("prompt thirteen ", "fourthKey"), "inputBooleanInSeries then honors no-to-all"); - assertEquals("prompt ten prompt eleven prompt twelve yes%nprompt " + - "thirteen no%n".formatted(), ostream.toString(), "inputBooleanInSeries shows prompts"); + assertEquals("prompt ten prompt eleven prompt twelve yes%nprompt thirteen no%n".formatted(), + ostream.toString(), "inputBooleanInSeries shows prompts"); } /** diff --git a/drivers.exploration.old/src/test/java/drivers/exploration/old/TestExplorationRunner.java b/drivers.exploration.old/src/test/java/drivers/exploration/old/TestExplorationRunner.java index 5d646c255..d113fe49e 100644 --- a/drivers.exploration.old/src/test/java/drivers/exploration/old/TestExplorationRunner.java +++ b/drivers.exploration.old/src/test/java/drivers/exploration/old/TestExplorationRunner.java @@ -127,13 +127,13 @@ public void testDefaultResults() throws MissingTableException { assertEquals("The primary rock type here is test_rock.", runner.defaultResults(point, TileType.Tundra, false, Collections.emptyList(), dimensions), "defaultResults in non-forest"); - assertEquals("The primary rock type here is test_rock.%n" + - "The main kind of tree here is boreal_tree.%n".formatted(), + assertEquals( + "The primary rock type here is test_rock.%nThe main kind of tree here is boreal_tree.%n".formatted(), runner.defaultResults(point, TileType.Steppe, false, Collections.singletonList( new Forest("boreal_tree", false, 1)), dimensions), "defaultResults in boreal forest"); - assertEquals("The primary rock type here is test_rock.%n" + - "The main kind of tree here is temperate_tree.%n".formatted(), + assertEquals( + "The primary rock type here is test_rock.%nThe main kind of tree here is temperate_tree.%n".formatted(), runner.defaultResults(point, TileType.Plains, false, Collections.singletonList( new Forest("temperate_tree", false, 2)), dimensions), "defaultResults in temperate forest");