Skip to content

Commit e85f65e

Browse files
committed
Test Text.getLineDelimiter not only on Windows
Some minor syntax improvements too.
1 parent 648a444 commit e85f65e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,10 @@ public void test_getLineCount() {
515515
public void test_getLineDelimiter() {
516516
String platform = SWT.getPlatform();
517517
String delimiter = text.getLineDelimiter();
518-
if (platform.equals("win32")) {
519-
assertEquals("\r\n", delimiter);
518+
switch(platform) {
519+
case "win32" -> assertEquals("\r\n", delimiter);
520+
case "cocoa" -> assertEquals ("\r", delimiter);
521+
default-> assertEquals("\n", delimiter);
520522
}
521523
}
522524

@@ -1083,12 +1085,9 @@ public void test_setEditableZ() {
10831085
@Test
10841086
public void test_setFontLorg_eclipse_swt_graphics_Font() {
10851087
FontData fontData = text.getFont().getFontData()[0];
1086-
int lineHeight;
1087-
Font font;
1088-
1089-
font = new Font(text.getDisplay(), fontData.getName(), 8, fontData.getStyle());
1088+
Font font = new Font(text.getDisplay(), fontData.getName(), 8, fontData.getStyle());
10901089
text.setFont(font);
1091-
lineHeight = text.getLineHeight();
1090+
int lineHeight = text.getLineHeight();
10921091
text.setFont(null);
10931092
font.dispose();
10941093
font = new Font(text.getDisplay(), fontData.getName(), 12, fontData.getStyle());

0 commit comments

Comments
 (0)