From f5dd63819d9f0cab89d8558b3b9c596e5056c9b7 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 1 May 2022 19:55:43 -0400 Subject: Windows perl workaround --- libtests/qtest/json_parse.test | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'libtests') diff --git a/libtests/qtest/json_parse.test b/libtests/qtest/json_parse.test index d97b05cb..cdafb506 100644 --- a/libtests/qtest/json_parse.test +++ b/libtests/qtest/json_parse.test @@ -12,13 +12,22 @@ require TestDriver; my $td = new TestDriver('json_parse'); my $json_mod = 0; -eval { - require JSON; - $json_mod = 1; -}; -if ($@) +if ($^O ne 'msys') { - $td->emphasize("JSON.pm not found -- using stored actual outputs"); + # Emperical evidence and considerable debugging reveals that in + # some versions of perl (e.g. the one with git bash on the GitHub + # actions Windows 2022 build environment), using the JSON module + # defeats the functionality of binmode when writing test output + # files, thus invalidating NORMALIZE_NEWLINES. This causes test + # failures and spurious upadtes to save files in CI on MSVC. + eval { + require JSON; + $json_mod = 1; + }; + if ($@) + { + $td->emphasize("JSON.pm not found -- using stored actual outputs"); + } } cleanup(); -- cgit v1.2.3-54-g00ecf