Skip to content

Commit

Permalink
Some rewording and reformatting to fix too-long lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjon3377 committed Mar 9, 2024
1 parent b2f0fd9 commit 0a48e3f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
11 changes: 6 additions & 5 deletions drivers.common/src/test/java/drivers/common/cli/CLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ public void testChooseFromList() {
"chooseFromList chooses only choice when this is specified",
"chooseFromList automatically chose only choice");
assertCLI(cli -> cli.<Player>chooseFromList(Collections.singletonList(new PlayerImpl(1, "one")),
"test desc", "none present", "prompt", ICLIHelper.ListChoiceBehavior.ALWAYS_PROMPT), Collections.singletonList("0"),
String.format("test desc%n0: one%nprompt "), Pair.with(0, new PlayerImpl(1, "one")),
"test desc", "none present", "prompt", ICLIHelper.ListChoiceBehavior.ALWAYS_PROMPT),
Collections.singletonList("0"), String.format("test desc%n0: one%nprompt "),
Pair.with(0, new PlayerImpl(1, "one")),
"chooseFromList doesn't always auto-choose only choice",
"chooseFromList didn't automatically choose only choice");
}
Expand Down Expand Up @@ -353,9 +354,9 @@ public void testInputBooleanInSeriesSeparateKeys() {
@Test
public void testChooseStringFromList() {
assertCLI(cli -> cli.chooseStringFromList(Arrays.asList("one", "two"),
"test desc", "none present", "prompt", ICLIHelper.ListChoiceBehavior.ALWAYS_PROMPT), Collections.singletonList("0"),
String.format("test desc%n0: one%n1: two%nprompt "), Pair.with(0, "one"),
"chooseStringFromList chooses the one specified by the user",
"test desc", "none present", "prompt", ICLIHelper.ListChoiceBehavior.ALWAYS_PROMPT),
Collections.singletonList("0"), String.format("test desc%n0: one%n1: two%nprompt "),
Pair.with(0, "one"), "chooseStringFromList chooses the one specified by the user",
"chooseStringFromList prompts the user");
assertCLI(cli -> cli.chooseStringFromList(Arrays.asList("one", "two", "three"),
"test desc", "none present", "prompt two", ICLIHelper.ListChoiceBehavior.AUTO_CHOOSE_ONLY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ private static void noop(final String str) {
@Test
public void testExpansionWithSubsets() {
final MapDimensions dims = new MapDimensionsImpl(2, 2, 2);
final IMutableLegacyMap master = new LegacyMap(dims, playerCollection("independent", "main", "second", "independent"), 0);
final IMutableLegacyMap subMap = new LegacyMap(dims, playerCollection("main", "main", "second", "independent"), 0);
final IMutableLegacyMap master = new LegacyMap(dims,
playerCollection("independent", "main", "second", "independent"), 0);
final IMutableLegacyMap subMap = new LegacyMap(dims,
playerCollection("main", "main", "second", "independent"), 0);
for (final Point point : master.getLocations()) {
master.setBaseTerrain(point, TileType.Plains);
subMap.setBaseTerrain(point, TileType.Plains);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class AdvancementCLIFactory implements ModelDriverFactory {
private static final IDriverUsage USAGE = new DriverUsage(false, "advance", ParamCount.AtLeastOne,
"View a player's workers and manage their advancement",
"View a player's units, the workers in those units, each worker's Jobs, and his/her level in each Skill in each Job.",
"View a player's units, workers in those units, each worker's Jobs, and Skill levels in each Job.",
true, false, "--current-turn=NN", "--allow-expert-mentoring");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class AdvancementGUIFactory implements GUIDriverFactory {
private static final IDriverUsage USAGE = new DriverUsage(true, "advance", ParamCount.AtLeastOne,
"Worker Skill Advancement",
"View a player's units, the workers in those units, each worker's Jobs, and his/her level in each Skill in each Job.",
"View a player's units, workers in those units, each worker's Jobs, and Skill levels in each Job.",
false, true, "--current-turn=NN");

@Override
Expand Down
6 changes: 3 additions & 3 deletions model/src/test/java/legacy/map/TestPointIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void testFromBeginning() {
new Point(0, 2), new Point(1, 0), new Point(1, 1), new Point(1, 2),
new Point(2, 0), new Point(2, 1), new Point(2, 2)),
new PointIterable(new MapDimensionsImpl(3, 3, 1), true, true),
"Iterator should produce points in the expected order when given no starting point and iterating forwards horizontally.");
"Forward horizontal iterator with no starting point should produce points in expected order.");
}

/**
Expand All @@ -31,7 +31,7 @@ public void testFromSelection() {
new Point(2, 2), new Point(0, 0), new Point(0, 1), new Point(0, 2),
new Point(1, 0), new Point(1, 1)),
new PointIterable(new MapDimensionsImpl(3, 3, 1), true, true, new Point(1, 1)),
"Iterator should produce points in the expected order when given a starting point and iterating forwards horizontally.");
"Forward horizontal iterator with starting point should produce points in expected order.");
}

/**
Expand All @@ -42,7 +42,7 @@ public void testInitialSelection() {
assertIterableEquals(Arrays.asList(new Point(0, 0), new Point(1, 0), new Point(2, 0), new Point(0, 1),
new Point(1, 1), new Point(2, 1), new Point(0, 2), new Point(1, 2), new Point(2, 2)),
new PointIterable(new MapDimensionsImpl(3, 3, 1), true, false, Point.INVALID_POINT),
"Iterator should produce points in the expected order when starting at {@link Point#invalidPoint} and iterating forwards vertically.");
"Forward vertical iterator with invalid starting point should produce points in expected order.");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* Tests that proxy-units work properly, initially to aid in debugging an issue with (the port to Java of) the advancement feature.
* Tests that proxy-units work properly, initially to aid in debugging an issue with (the port to Java of) the
* advancement feature.
*/
public class TestProxyUnit {
private static IUnit createUnitForFirstTest(final Player owner) {
Expand Down
6 changes: 4 additions & 2 deletions model/src/test/java/legacy/xmlio/TestXMLIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public final class TestXMLIO {
* TODO: Extract interface for ISPReader&amp;IMapReader, so we don't
* have to maintain separate names for the same objects.
*/
private final List<ISPReader> spReaders = List.of(TestReaderFactory.getOldSPReader(), TestReaderFactory.getNewSPReader());
private final List<IMapReader> mapReaders = List.of(TestReaderFactory.getOldMapReader(), TestReaderFactory.getNewMapReader());
private final List<ISPReader> spReaders = List.of(TestReaderFactory.getOldSPReader(),
TestReaderFactory.getNewSPReader());
private final List<IMapReader> mapReaders = List.of(TestReaderFactory.getOldMapReader(),
TestReaderFactory.getNewMapReader());

/**
* Assert that the given XML will produce the given kind of warning and
Expand Down

0 comments on commit 0a48e3f

Please sign in to comment.