Skip to content

Commit

Permalink
pmd
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19262 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
taylor.smock committed Nov 25, 2024
1 parent 49e09d9 commit 959aad5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public void testAddToPanel() {
@ParameterizedTest
@ValueSource(strings = {"\n\n\n\t\r {0}\n\n\n", "{0}"})
void testNonRegression24023(String inscription) {
// There is a bit of "extra" whitespace in the string (` \n`). It is somewhat deliberate. We probably ought to remove the ` ` at some time.
// There is a bit of "extra" whitespace in the string (` \n`). It is somewhat deliberate.
// We probably ought to remove the ` ` at some time.
final String expected = "This is a \nsample \ninscription";
final String toTest = MessageFormat.format(inscription, expected).replace("sample ", "sample ");
final Collection<TaggingPreset> presets = TaggingPresets.getMatchingPresets(Collections.singleton(TaggingPresetType.NODE), Map.of("historic", "boundary_stone", "inscription", "bar"), false);
final Collection<TaggingPreset> presets = TaggingPresets.getMatchingPresets(Collections.singleton(TaggingPresetType.NODE),
Map.of("historic", "boundary_stone", "inscription", "bar"), false);
assertEquals(1, presets.size());
final TaggingPreset preset = presets.iterator().next();
final Text text = assertInstanceOf(Text.class, preset.data.get(5));
Expand All @@ -67,7 +69,8 @@ void testNonRegression24023(String inscription) {
while (value instanceof JPanel) {
value = (JComponent) value.getComponent(0);
}
final JosmTextField textField = assertInstanceOf(JosmTextField.class, value, "Until we support multiline editing, this should be a text field");
final JosmTextField textField = assertInstanceOf(JosmTextField.class, value,
"Until we support multiline editing, this should be a text field");
textField.setText(toTest);
text.addCommands(changeCommands);
assertTrue(text.multiline);
Expand Down

0 comments on commit 959aad5

Please sign in to comment.