Signed-off-by: Francois Gouget fgouget@codeweavers.com --- programs/cmd/tests/test_builtins.cmd | 41 +++++++++++++++++++++++- programs/cmd/tests/test_builtins.cmd.exp | 15 ++++++++- 2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 3f410e55166..cc0b960a50a 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -585,7 +585,6 @@ cd dummydir echo %~dp0 cd .. rmdir dummydir -echo CD value %CD% echo %% echo P% echo %P @@ -1789,6 +1788,46 @@ set /a WINE_foo=5 set /a WINE_bar=WINE_foo=6 call :checkenvvars WINE_foo 6 WINE_bar 6
+echo --- Magic environment variables +if defined cd (echo Has %%cd%%) else (echo Not defined) +echo CD value %CD% + +rem Some locales include the day-of-week either before or after the +rem day-month-year part. This makes it impossible to check the content of %date% +if defined date (echo Has %%date%%) else (echo Not defined) +set WINE_foo=%date:~9,1% +if defined WINE_foo (echo Good %%date%%) else (echo Too short) + +set WINE_before=%date% +for /f "usebackq tokens=*" %%i in (`date /t`) do set WINE_foo=%%i +set WINE_after=%date% +rem Use extra parentheses to work around a Wine bug +if not "%WINE_foo%"=="%WINE_before% " (if not "%WINE_foo%"=="%WINE_after% " (echo date /t != %%date%%) else (echo Match)) else (echo Match) + +if defined errorlevel (echo Has %%errorlevel%%) else (echo Not defined) + +if defined time (echo Has %%time%%) else (echo Not defined) +set WINE_foo=%time:~7,1% +if defined WINE_foo (echo %%time%% has seconds) else (echo Too short) +set WINE_foo=%time:~10,1% +if defined WINE_foo (echo %%time%% has 1/100s) else (echo Too short) +set WINE_foo=%time:~11,1% +if not defined WINE_foo (echo End of %%time%%) else (echo Too long) + +rem %time% has a leading space instead of a zero so ignore the first character. +rem It is also in 24h mode while time /t may be in am/pm mode so ignore the +rem second character too. +set WINE_before=%time:~2,3% +for /f "usebackq tokens=*" %%i in (`time /t`) do set WINE_foo=%%i +set WINE_after=%time:~2,3% +set WINE_foo=%WINE_foo:~2,99% +rem Use extra parentheses to work around a Wine bug +if not "%WINE_foo%"=="%WINE_before%" (if not "%WINE_foo%"=="%WINE_after%" (echo time /t != %%time:~2,3%%) else (echo Match)) else (echo Match) + +if defined random (echo Has %%random%%) else (echo Not defined) +set WINE_foo=%random% +if %WINE_foo% neq %random% (echo %%random%% looks random) else (echo Constant?) + echo --- for /F mkdir foobar & cd foobar echo ------ string argument diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 8b6e0914112..15fda131a5c 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -500,7 +500,6 @@ I'm here!@space@ ~dp0 should be directory containing batch file @drive@@path@ @drive@@path@ -CD value @pwd@@or_broken@CD value@space@ % P P @@ -1216,6 +1215,20 @@ WINE_foo correctly 7 WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8] WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6] WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] +--- Magic environment variables +@todo_wine@Has %cd% +CD value @pwd@@or_broken@CD value@space@ +@todo_wine@Has %date% +@todo_wine@Good %date% +@todo_wine@Match +@todo_wine@Has %errorlevel% +@todo_wine@Has %time% +@todo_wine@%time% has seconds +@todo_wine@%time% has 1/100s +End of %time% +@todo_wine@Match +@todo_wine@Has %random% +%random% looks random --- for /F ------ string argument a
Stub out the subsecond decimals.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52719 Signed-off-by: Francois Gouget fgouget@codeweavers.com --- GetTimeFormatEx() does not support formatting fractions of a second. So just stub that out until there is a need for it. At least now echo %time% can be used to see where a batch file spends its time. --- programs/cmd/tests/test_builtins.cmd.exp | 2 +- programs/cmd/wcmdmain.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 15fda131a5c..9075b4e3246 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1223,7 +1223,7 @@ CD value @pwd@@or_broken@CD value@space@ @todo_wine@Match @todo_wine@Has %errorlevel% @todo_wine@Has %time% -@todo_wine@%time% has seconds +%time% has seconds @todo_wine@%time% has 1/100s End of %time% @todo_wine@Match diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index af54b209d83..318e8e6e454 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -621,8 +621,12 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR startchar) NULL, thisVarContents, MAXSTRING); len = lstrlenW(thisVarContents); } else if (WCMD_is_magic_envvar(thisVar, L"TIME")) { - GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, + GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, NULL, thisVarContents, MAXSTRING); + /* FIXME This should have 1/100s precision and a localized decimal + * separator. */ + if (*thisVarContents == '0') *thisVarContents = ' '; + lstrcatW(thisVarContents, L".00"); len = lstrlenW(thisVarContents); } else if (WCMD_is_magic_envvar(thisVar, L"CD")) { GetCurrentDirectoryW(MAXSTRING, thisVarContents);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112701
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_el (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_2qxl (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ar (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_he (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ja (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_zh_CN (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1227 (got '%time% has 1/100s', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit Arabic:Morocco report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1222 (got 'Good %date%', wanted 'Good %date%')
=== debian11 (32 bit Hindi:India report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1227 (got '%time% has 1/100s', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit WoW report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1227 (got '%time% has 1/100s', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (64 bit WoW report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1227 (got '%time% has 1/100s', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
The expanded string length must include the trailing null character for 'magic' environment variables too.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- Compare the lstrlenW() return value with ExpandEnvironmentStringsW()'s. --- programs/cmd/tests/test_builtins.cmd.exp | 4 ++-- programs/cmd/wcmdmain.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 9075b4e3246..00224d033c6 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1219,12 +1219,12 @@ WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] @todo_wine@Has %cd% CD value @pwd@@or_broken@CD value@space@ @todo_wine@Has %date% -@todo_wine@Good %date% +Good %date% @todo_wine@Match @todo_wine@Has %errorlevel% @todo_wine@Has %time% %time% has seconds -@todo_wine@%time% has 1/100s +%time% has 1/100s End of %time% @todo_wine@Match @todo_wine@Has %random% diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 318e8e6e454..61812b7a7d4 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -615,11 +615,11 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR startchar) /* override if existing env var called that name */ if (WCMD_is_magic_envvar(thisVar, L"ERRORLEVEL")) { wsprintfW(thisVarContents, L"%d", errorlevel); - len = lstrlenW(thisVarContents); + len = lstrlenW(thisVarContents) + 1; } else if (WCMD_is_magic_envvar(thisVar, L"DATE")) { GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, thisVarContents, MAXSTRING); - len = lstrlenW(thisVarContents); + len = lstrlenW(thisVarContents) + 1; } else if (WCMD_is_magic_envvar(thisVar, L"TIME")) { GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, NULL, thisVarContents, MAXSTRING); @@ -627,13 +627,13 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR startchar) * separator. */ if (*thisVarContents == '0') *thisVarContents = ' '; lstrcatW(thisVarContents, L".00"); - len = lstrlenW(thisVarContents); + len = lstrlenW(thisVarContents) + 1; } else if (WCMD_is_magic_envvar(thisVar, L"CD")) { GetCurrentDirectoryW(MAXSTRING, thisVarContents); - len = lstrlenW(thisVarContents); + len = lstrlenW(thisVarContents) + 1; } else if (WCMD_is_magic_envvar(thisVar, L"RANDOM")) { wsprintfW(thisVarContents, L"%d", rand() % 32768); - len = lstrlenW(thisVarContents); + len = lstrlenW(thisVarContents) + 1; } else {
len = ExpandEnvironmentStringsW(thisVar, thisVarContents, ARRAY_SIZE(thisVarContents));
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112702
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_el (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_2qxl (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ar (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_he (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ja (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_zh_CN (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit German report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit Hebrew:Israel report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit Hindi:India report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit Japanese:Japan report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (32 bit Chinese:China report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
=== debian11 (64 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%')
They just output the date / time, without any explanatory text. Furthermore time /t only returns the time down to the minute.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52719 Signed-off-by: Francois Gouget fgouget@codeweavers.com --- programs/cmd/builtins.c | 22 +++++++++++++++++----- programs/cmd/tests/test_builtins.cmd.exp | 4 ++-- 2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 963a9eaf361..d3d62d7dc56 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -3503,14 +3503,20 @@ void WCMD_setshow_date (void) {
if (!*param1) { if (GetDateFormatW(LOCALE_USER_DEFAULT, 0, NULL, NULL, curdate, ARRAY_SIZE(curdate))) { - WCMD_output (WCMD_LoadMessage(WCMD_CURRENTDATE), curdate); if (wcsstr(quals, L"/T") == NULL) { + WCMD_output (WCMD_LoadMessage(WCMD_CURRENTDATE), curdate); WCMD_output (WCMD_LoadMessage(WCMD_NEWDATE)); WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), buffer, ARRAY_SIZE(buffer), &count); if (count > 2) { WCMD_output_stderr (WCMD_LoadMessage(WCMD_NYI)); } } + else { + WCMD_output (curdate); + /* The tests show there is a trailing space, maybe to make it easier + * to append the time. */ + WCMD_output (L" "); + } } else WCMD_print_error (); } @@ -4291,17 +4297,23 @@ void WCMD_setshow_time (void) {
if (!*param1) { GetLocalTime(&st); - if (GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, curtime, ARRAY_SIZE(curtime))) { - WCMD_output (WCMD_LoadMessage(WCMD_CURRENTTIME), curtime); - if (wcsstr(quals, L"/T") == NULL) { + if (wcsstr(quals, L"/T") == NULL) { + if (GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, curtime, ARRAY_SIZE(curtime))) { + WCMD_output (WCMD_LoadMessage(WCMD_CURRENTTIME), curtime); WCMD_output (WCMD_LoadMessage(WCMD_NEWTIME)); WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), buffer, ARRAY_SIZE(buffer), &count); if (count > 2) { WCMD_output_stderr (WCMD_LoadMessage(WCMD_NYI)); } } + else WCMD_print_error (); + } + else { + if (GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, curtime, ARRAY_SIZE(curtime))) { + WCMD_output (curtime); + } + else WCMD_print_error (); } - else WCMD_print_error (); } else { WCMD_output_stderr (WCMD_LoadMessage(WCMD_NYI)); diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 00224d033c6..0d55d6b8630 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1220,13 +1220,13 @@ WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] CD value @pwd@@or_broken@CD value@space@ @todo_wine@Has %date% Good %date% -@todo_wine@Match +Match @todo_wine@Has %errorlevel% @todo_wine@Has %time% %time% has seconds %time% has 1/100s End of %time% -@todo_wine@Match +Match @todo_wine@Has %random% %random% looks random --- for /F
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112703
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_el (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_2qxl (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ar (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_he (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ja (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_zh_CN (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit German report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit Hebrew:Israel report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Hindi:India report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Japanese:Japan report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Chinese:China report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (64 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- programs/cmd/builtins.c | 13 +++++++++++-- programs/cmd/tests/test_builtins.cmd.exp | 10 +++++----- 2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index d3d62d7dc56..7ece4b52a9e 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2823,8 +2823,17 @@ int evaluate_if_condition(WCHAR *p, WCHAR **command, int *test, int *negate) WCMD_parameter(p, 2+(*negate), command, FALSE, FALSE); } else if (!lstrcmpiW(condition, L"defined")) { - *test = (GetEnvironmentVariableW(WCMD_parameter(p, 1+(*negate), NULL, FALSE, FALSE), - NULL, 0) > 0); + const WCHAR* name = WCMD_parameter(p, 1+(*negate), NULL, FALSE, FALSE); + if (lstrcmpiW(name, L"cd") == 0 || + lstrcmpiW(name, L"date") == 0 || + lstrcmpiW(name, L"errorlevel") == 0 || + lstrcmpiW(name, L"random") == 0 || + lstrcmpiW(name, L"time") == 0) { + *test = 1; + } + else { + *test = (GetEnvironmentVariableW(name, NULL, 0) > 0); + } WCMD_parameter(p, 2+(*negate), command, FALSE, FALSE); } else { /* comparison operation */ diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 0d55d6b8630..0cfbaebfd85 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1216,18 +1216,18 @@ WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8] WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6] WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] --- Magic environment variables -@todo_wine@Has %cd% +Has %cd% CD value @pwd@@or_broken@CD value@space@ -@todo_wine@Has %date% +Has %date% Good %date% Match -@todo_wine@Has %errorlevel% -@todo_wine@Has %time% +Has %errorlevel% +Has %time% %time% has seconds %time% has 1/100s End of %time% Match -@todo_wine@Has %random% +Has %random% %random% looks random --- for /F ------ string argument
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112704
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_el (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_2qxl (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ar (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_he (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ja (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_zh_CN (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit German report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit Hebrew:Israel report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Hindi:India report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Japanese:Japan report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1227 (got 'Too short', wanted '%time% has 1/100s') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Chinese:China report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%')
=== debian11 (32 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (64 bit WoW report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1222 (got 'Too short', wanted 'Good %date%') batch.c:321: Test failed: unexpected char 0x54 position 0 in line 1228 (got 'Too long', wanted 'End of %time%') batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112700
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w7u_el (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w8adm (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (32 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w864 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1507 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064v1809 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_2qxl (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w1064_tsign (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64 (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ar (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_he (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_ja (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== w10pro64_zh_CN (64 bit report) ===
cmd.exe: batch.c:321: Test failed: unexpected char 0x74 position 0 in line 1229 (got 'time /t != %time:~2,3%', wanted 'Match')
=== debian11 (32 bit Arabic:Morocco report) ===
cmd.exe: batch.c:321: Test succeeded inside todo block: unexpected char 0x0 position -1 in line 1222 (got 'Good %date%', wanted 'Good %date%')
Hmph. The tests need to shop off the AM PM suffix in the time /t output. Resending.