Subject: | Tests fail on Windows due to creating bad JSON |
On Windows, t/Duplicate.t fails because on Windows, the variable $firstIncludeFile contains a backslash and is interpolated directly into the JSON as
"includes" : [ "$firstIncludeFile", "$secondIncludeFile"]
instead of doubling the backslashes as one does for JSON.
This makes the test fail.
Adding two properly escaped values:
(my $firstIncludeFile_q = $firstIncludeFile) =~ s!\\!\\\\!g;
(my $secondIncludeFile_q = $secondIncludeFile) =~ s!\\!\\\\!g;
and interpolating these, makes the tests pass:
"includes" : [ "$firstIncludeFile_q", "$secondIncludeFile_q"]