From f7ae705d8ffb4ee7fbda84fc4f0641571be7a49a Mon Sep 17 00:00:00 2001 From: James Holderness Date: Sun, 28 Jul 2024 10:53:40 +0100 Subject: [PATCH] Add unit tests --- .../adapter/ut_adapter/adapterTest.cpp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/terminal/adapter/ut_adapter/adapterTest.cpp b/src/terminal/adapter/ut_adapter/adapterTest.cpp index ca44278b96e1..326859a51c6f 100644 --- a/src/terminal/adapter/ut_adapter/adapterTest.cpp +++ b/src/terminal/adapter/ut_adapter/adapterTest.cpp @@ -1942,6 +1942,55 @@ class AdapterTest requestSetting(L"m"); _testGetSet->ValidateInputEvent(L"\033P1$r0;38:2::12:34:56;48:2::65:43:21;58:2::128:222:45m\033\\"); + Log::Comment(L"Requesting DECSCUSR style (blinking block)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(true); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::FullBox); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r1 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (steady block)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(false); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::FullBox); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r2 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (blinking underline)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(true); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::Underscore); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r3 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (steady underline)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(false); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::Underscore); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r4 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (blinking bar)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(true); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::VerticalBar); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r5 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (steady bar)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(false); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::VerticalBar); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r6 q\033\\"); + + Log::Comment(L"Requesting DECSCUSR style (non-standard)."); + _testGetSet->PrepData(); + _testGetSet->_textBuffer->GetCursor().SetBlinkingAllowed(true); + _testGetSet->_textBuffer->GetCursor().SetType(CursorType::Legacy); + requestSetting(L" q"); + _testGetSet->ValidateInputEvent(L"\033P1$r0 q\033\\"); + Log::Comment(L"Requesting DECSCA attributes (unprotected)."); _testGetSet->PrepData(); attribute = {};