summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-08-24 15:20:15 +0000
committerJunio C Hamano <gitster@pobox.com>2018-08-27 14:07:32 -0700
commit8c97e3873156415015ab41523675416c91914eae (patch)
tree6358435a1d1391d971dad14265d5ff5a30b17d40 /contrib/persistent-https
parenta3c4c8841caaf8bda924d0852670be4ea7461a7d (diff)
downloadgit-8c97e3873156415015ab41523675416c91914eae.tar.gz
git-8c97e3873156415015ab41523675416c91914eae.zip
tests: fix version-specific portability issue in Perl JSON
The test guarded by PERLJSON added in 75459410ed ("json_writer: new routines to create JSON data", 2018-07-13) assumed that a JSON boolean value like "true" or "false" would be represented as "1" or "0" in Perl. This behavior can't be relied upon, e.g. with JSON.pm 2.50 and JSON::PP. A JSON::PP::Boolean object will be represented as "true" or "false". To work around this let's check if we have any refs left after we check for hashes and arrays, assume those are JSON objects, and coerce them to a known boolean value. The behavior of this test still looks odd to me. Why implement our own ad-hoc encoder just for some one-off test, as opposed to say Perl's own Data::Dumper with Sortkeys et al? But with this change it works, so let's leave it be. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions