From: Thomas Csovcsity <thc.fr13nd@gmail.com> --- dlls/kernel32/tests/console.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 8ced7f1ad7e..b7d00e6b306 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -5737,21 +5737,34 @@ static void test_ANSI_escape_sequences(void) ok(ret, "SetConsoleCursorPosition failed\n"); ret = SetConsoleTextAttribute(hConOut, FOREGROUND_GREEN | FOREGROUND_INTENSITY); ok(ret, "SetConsoleTextAttribute failed\n"); - ret = WriteConsoleW(hConOut, L"GREEN\x1b[91mRED", 5+5+3, &dw, NULL); - ok(dw == 5+5+3, "Wrong count\n"); + ret = WriteConsoleW(hConOut, L"GREEN\x1b[91mBRIGHT RED", 5+5+10, &dw, NULL); + ok(dw == 5+5+10, "Wrong count\n"); ok(ret, "WriteConsole failed\n"); ret = GetConsoleScreenBufferInfo(hConOut, &sb_info); ok(ret, "GetConsoleScreenBufferInfo failed\n"); - ok(sb_info.dwCursorPosition.X == 5 + 3, "Incorrect X cursor position\n"); - ok(sb_info.dwCursorPosition.Y == 0, "Incorrect X cursor position\n"); + ok(sb_info.dwCursorPosition.X == 5 + 10, "Incorrect X cursor position\n"); + ok(sb_info.dwCursorPosition.Y == 0, "Incorrect Y cursor position\n"); todo_wine ok(sb_info.wAttributes == (FOREGROUND_RED | FOREGROUND_INTENSITY), "Unexpected attributes got %x, expected %x\n", sb_info.wAttributes, FOREGROUND_RED | FOREGROUND_INTENSITY); ret = SetConsoleTextAttribute(hConOut, FOREGROUND_BLUE | FOREGROUND_INTENSITY); ret = WriteConsoleW(hConOut, L"BLUE\x1b[m", 4+3, &dw, NULL); ok(dw == 4+3, "Wrong count\n"); ret = GetConsoleScreenBufferInfo(hConOut, &sb_info); - ok(sb_info.dwCursorPosition.X == 5 + 3 + 4, "Incorrect X cursor position\n"); - ok(sb_info.dwCursorPosition.Y == 0, "Incorrect X cursor position\n"); + ok(sb_info.dwCursorPosition.X == 5 + 10 + 4, "Incorrect X cursor position\n"); + ok(sb_info.dwCursorPosition.Y == 0, "Incorrect Y cursor position\n"); todo_wine ok(sb_info.wAttributes == (FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN), "Unexpected attributes: got %x, expected %x\n", sb_info.wAttributes, FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN); + ret = WriteConsoleW(hConOut, L"\n\x1b[31mRED", 1+5+3, &dw, NULL); + ok(dw == 1+5+3, "Wrong count\n"); + ret = GetConsoleScreenBufferInfo(hConOut, &sb_info); + ok(sb_info.dwCursorPosition.X == 3, "Incorrect X cursor position: got %d, expected %d\n", sb_info.dwCursorPosition.X, 3); + ok(sb_info.dwCursorPosition.Y == 1, "Incorrect Y cursor position\n"); + todo_wine ok(sb_info.wAttributes == (FOREGROUND_RED), "Unexpected attributes: got %x, expected %x\n", sb_info.wAttributes, FOREGROUND_RED); + ret = WriteConsoleW(hConOut, L"\x1b[31;44mRED on BLUE", 5+14, &dw, NULL); + ok(dw == 5+14, "Wrong count\n"); + ret = GetConsoleScreenBufferInfo(hConOut, &sb_info); + ok(sb_info.dwCursorPosition.X == 3+11, "Incorrect X cursor position: got %d, expected %d\n", sb_info.dwCursorPosition.X, 3+11); + ok(sb_info.dwCursorPosition.Y == 1, "Incorrect Y cursor position\n"); + todo_wine ok(sb_info.wAttributes == (FOREGROUND_RED | BACKGROUND_BLUE), "Unexpected attributes: got %x, expected %x\n", sb_info.wAttributes, FOREGROUND_RED | BACKGROUND_BLUE); + CloseHandle(hConOut); FreeConsole(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9973