Skip to content

Commit 9cc2334

Browse files
committed
Make test valid for backspace/delete
I noticed this test taking a very long time (10 seconds). The test as written is invalid because the loop has a timeout with hitting the exit condition. The "a" is never inserted into the text box (at least on gtk3), so the sending of back space appears to work when it didn't
1 parent 34becc0 commit 9cc2334

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5877,6 +5877,8 @@ public void test_backspaceAndDelete() {
58775877
}
58785878
}
58795879

5880+
assertEquals(1, text.getText().length());
5881+
58805882
// Simulate the backspace, ensuring that the caret is in the correct position
58815883
text.invokeAction(ST.DELETE_PREVIOUS);
58825884

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,8 @@ public void test_backspaceAndDelete() {
15751575
}
15761576
}
15771577

1578+
assertEquals(1, text.getText().length());
1579+
15781580
display.post(backspace);
15791581
display.post(backspaceUp);
15801582

0 commit comments

Comments
 (0)