This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix problems from Carp's partial EBCDIC support
authorZefram <zefram@fysh.org>
Thu, 20 Jul 2017 03:00:30 +0000 (04:00 +0100)
committerZefram <zefram@fysh.org>
Thu, 20 Jul 2017 03:00:30 +0000 (04:00 +0100)
commit285ac8e2a208401b204f46b958d170d1cc5bd361
tree000a01fe5824b52bb2b36ef0df9c7fcef337a6f5
parent3172fdbc0bbda2530c9d7ffc4c7b7d34a36db0dc
fix problems from Carp's partial EBCDIC support

Commit 975fe8546427b5f6259103912b13925be148becd introduced partial EBCDIC
support to Carp, but simultaneously introduced some bugs into the module
and the tests.  Multiple issues are addressed in this commit:

* The main check for whether a character needs a non-literal
  representation when dumping a string or regexp argument, which used
  to be a regexp character range [ -~], was expanded to an explicit
  character set not using range syntax, but in the expansion the "&"
  was omitted.  This caused unwanted \x representation of any "&" in an
  argument in a stack trace.  Add the "&" back in and fix the sorting
  of the character set.

* The substitute version of this check for Perls on which Carp can't
  safely apply a regexp to an upgraded string, but new enough to have
  utf8::native_to_unicode(), was applying that function to some fixed
  codepoint values that were already Unicode codepoints.  Remove those
  calls, and compare the fixed codepoints directly to codepoints correctly
  converted through that function.

* That version of the check, by referring to utf8::native_to_unicode()
  directly in source that is always compiled, caused the utf8:: stash to
  be vivified on Perl 5.6, causing havoc (and failed tests).  Hide that
  version of the check behind a (compile-time) string eval.

* Another version of the printability check, for EBCDIC on Perl 5.6,
  treated as printable any codepoint above 0xff.  Change that to correctly
  treat all such codepoints as not safely printable.

* Some tests in t/arg_regexp.t which were originally about non-ASCII
  characters specified in a regexp by using \x regexp syntax got changed
  to use the non-ASCII characters literally at the regexp syntax level
  (by interpolating them from a constructed string).  Restore these to
  using \x syntax, with the appropriate variability of the hex digits.

* Add a couple of "fixme" comments about parts of the EBCDIC support
  that are incomplete.

* Some tests involving non-ASCII characters were later made to skip on
  any Perl prior to 5.17.1.  In practice they work fine on earlier Perls,
  and they're fairly important.  Suspect that the problem that led to
  the skipping being added was dependent on the tests having been broken
  as described above, so remove the skipping logic.

* Incidentally, correct a comment about the purpose of t/arg_string.t
  and add a similar one to t/arg_regexp.t.

* Incidentally, add Changes entries for versions 1.41 and 1.42, which
  were omitted when those changes were made.
dist/Carp/Changes
dist/Carp/lib/Carp.pm
dist/Carp/lib/Carp/Heavy.pm
dist/Carp/t/arg_regexp.t
dist/Carp/t/arg_string.t