Skip to content

Commit

Permalink
Data-Dumper: fix bugs.t for non-XS testing
Browse files Browse the repository at this point in the history
This is a follow-up to 7d3a730, which
fixed an out-of-bounds write in Dumpxs when passed invalid UTF-8. This
test does not apply to the pure Perl implementation (which detects the
invalid input and cleanly throws an error instead).

Previously, testing without XS available would result in:

    t/bugs.t ...................... 1/24 Malformed UTF-8 character (fatal) at .../dist/Data-Dumper/blib/lib/Data/Dumper.pm line 587.
    # Looks like your test exited with 2 just after 6.
    t/bugs.t ...................... Dubious, test returned 2 (wstat 512, 0x200)
    Failed 18/24 subtests
    ...
    t/bugs.t                    (Wstat: 512 (exited 2) Tests: 6 Failed: 0)
      Non-zero exit status: 2
      Parse errors: Bad plan.  You planned 24 tests but ran 6.
  • Loading branch information
mauke committed Jan 9, 2025
1 parent c135673 commit 3caa23e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dist/Data-Dumper/t/bugs.t
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ SKIP: {

# writing out of bounds with malformed utf8
SKIP: {
skip("No XS available", 1) if !defined &Data::Dumper::Dumpxs;
eval { require Encode };
skip("Encode not available", 1) if $@;
local $^W=1;
Expand Down

0 comments on commit 3caa23e

Please sign in to comment.