From 3e29cd65252a33504eceb80273c70cc57bd377ea Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 23 Apr 2021 10:17:44 -0400 Subject: [PATCH] Bug 341721: Test for rename terminal escape sequence Change-Id: Id03f3d4361d0ac0ac0758c3f00eadbe2d6b568fc --- .../terminal/emulator/VT100EmulatorTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorTest.java index e4c4e43f2bf..32995d2bb6d 100644 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorTest.java +++ b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorTest.java @@ -34,6 +34,10 @@ public class VT100EmulatorTest { private static final String CLEAR_CURSOR_TO_EOL = "\033[K"; private static final String CURSOR_POSITION_TOP_LEFT = "\033[H"; + private static String TITLE(String title) { + return "\033]0;" + title + "\007"; + } + /** * Set the cursor position to line/column. Note that this is the logical * line and column, so 1, 1 is the top left. @@ -212,4 +216,14 @@ public class VT100EmulatorTest { assertAll(() -> assertCursorLocation(2, 1), () -> assertTextEquals(expected)); } + @Test + public void testTitle() { + run( // + TITLE("TITLE1"), // + "HELLO", // + TITLE("TITLE2")); + assertAll(() -> assertTextEquals("HELLO"), + () -> assertEquals(List.of("TITLE1", "TITLE2"), control.getAllTitles())); + } + }