Subject: | test depend on window size |
Date: | Tue, 16 Jun 2015 10:52:29 +0000 |
To: | "bug-Win32-Console-ANSI [...] rt.cpan.org" <bug-Win32-Console-ANSI [...] rt.cpan.org> |
From: | "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de> |
Hi,
the following tests failed for me:
t/04_DisplayEdition.t (Wstat: 0 Tests: 74 Failed: 74)
Failed tests: 1-74
t/05_Colors.t (Wstat: 0 Tests: 36 Failed: 35)
Failed tests: 1-35
t/07_TortureMeHoney.t (Wstat: 0 Tests: 3 Failed: 3)
Failed tests: 1-3
t/08_Compatibility.t (Wstat: 0 Tests: 3 Failed: 3)
Failed tests: 1-3
Analysis shows that they all use
SetConsoleSize(80, 25);
to set a standard size and compare the result of Win32::Console::ANSI::_ScreenDump() with some shipped result hashes.
On my system Win32::Console::ANSI::_ScreenDump() returns 13440 bytes, i.e. 3660 character cells. Apart from that for test 1 of 04_DisplayEdition.pl, which I checked, the content matches the function calls, but there are too many character cells. My CMD consoles are 42 lines high, 80*42 = 3660. SetConsoleSize() obviously failed to set a size below that of the default.
Like in the previous bug #105257, 04_DisplayEdition.pl works when I set the _default_ window size to 80x25. Setting the size of the current window makes no difference.
My thoughts on fixing this are the same as in #105257, one could:
- skip the test if the terminal size is not 80x25
- make it work with different sizes, e.g. clip the result of Win32::Console::ANSI::_ScreenDump() to an 80x25 screen buffer before md5_hex()
- maybe open the console used for the tests with a fixed size independent of the user settings.
Ralf