Skip to content

[PATCH] eol.t: Don't test for CR as line separator as that is deprecated #11469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue Jul 1, 2011 · 8 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Jul 1, 2011

Migrated from rt.perl.org#93878 (status was 'rejected')

Searchable as RT93878$

@p5pRT
Copy link
Author

p5pRT commented Jul 1, 2011

From [email protected]

This is a bug report for perl from marcgreen@​wpi.edu,
generated with the help of perlbug 1.39 running under perl 5.14.0.


lib/Pod/t/eol.t | 28 +++++-----------------------
1 files changed, 5 insertions(+), 23 deletions(-)

Inline Patch
diff --git a/lib/Pod/t/eol.t b/lib/Pod/t/eol.t
index 987c150..2a401cb 100644
--- a/lib/Pod/t/eol.t
+++ b/lib/Pod/t/eol.t
@@ -1,6 +1,6 @@
 #!./perl -w

-use Test::More tests => 3;
+use Test::More tests => 1;

 open(POD, ">$$.pod") or die "$$.pod: $!";
 print POD <<__EOF__;
@@ -32,19 +32,6 @@ close(POD);

 use Pod::Html;

-# --- CR ---
-
-open(POD, "<$$.pod") or die "$$.pod: $!";
-open(IN,  ">$$.in")  or die "$$.in: $!";
-while (<POD>) {
-  s/[\r\n]+/\r/g;
-  print IN $_;
-}
-close(POD);
-close(IN);
-
-pod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o1");
-
 # --- LF ---

 open(POD, "<$$.pod") or die "$$.pod: $!";
@@ -56,7 +43,7 @@ while (<POD>) {
 close(POD);
 close(IN);

-pod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o2");
+pod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o1");

 # --- CRLF ---

@@ -69,7 +56,7 @@ while (<POD>) {
 close(POD);
 close(IN);

-pod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o3");
+pod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o2");

 # --- now test ---

@@ -81,15 +68,10 @@ my $cksum1 = unpack("%32C*", <IN>);
 open(IN, "<$$.o2") or die "$$.o2: $!";
 my $cksum2 = unpack("%32C*", <IN>);

-open(IN, "<$$.o3") or die "$$.o3: $!";
-my $cksum3 = unpack("%32C*", <IN>);
-
-ok($cksum1 == $cksum2, "CR vs LF");
-ok($cksum1 == $cksum3, "CR vs CRLF");
-ok($cksum2 == $cksum3, "LF vs CRLF");
+ok($cksum1 == $cksum2, "LF vs CRLF");
 close IN;

 END {
-  1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2", "$$.o3",
+  1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2",
                  "pod2htmd.x~~", "pod2htmi.x~~");
 }
--
1.7.0.4

Flags​:
  category=library
  severity=low
  module=Pod​::Html


Site configuration information for perl 5.14.0​:

Configured by marc at Fri Jun 3 17​:13​:58 EDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration​:

  Platform​:
  osname=linux, osvers=2.6.32-32-generic, archname=i686-linux
  uname='linux cubone 2.6.32-32-generic #62-ubuntu smp wed apr 20 21​:54​:21 utc 2011 i686 gnulinux '
  config_args='-de -Dprefix=/home/marc/perl5/perlbrew/perls/perl-5.14.0'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.4.3', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib/i486-linux-gnu /usr/lib64
  libs=-lnsl -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.11.1'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches​:


@​INC for perl 5.14.0​:
  /home/marc/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/i686-linux
  /home/marc/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0
  /home/marc/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0/i686-linux
  /home/marc/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0
  .


Environment for perl 5.14.0​:
  HOME=/home/marc
  LANG=en_US.utf8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/marc/perl5/perlbrew/bin​:/home/marc/perl5/perlbrew/perls/perl-5.14.0/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games
  PERLBREW_HOME=/home/marc/.perlbrew
  PERLBREW_PATH=/home/marc/perl5/perlbrew/bin​:/home/marc/perl5/perlbrew/perls/perl-5.14.0/bin
  PERLBREW_PERL=perl-5.14.0
  PERLBREW_ROOT=/home/marc/perl5/perlbrew
  PERLBREW_VERSION=0.23
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jul 3, 2011

From @cpansprout

On Thu Jun 30 18​:43​:16 2011, marcgreen@​WPI.EDU wrote​:

This is a bug report for perl from marcgreen@​wpi.edu,
generated with the help of perlbug 1.39 running under perl 5.14.0.

---
lib/Pod/t/eol.t | 28 +++++-----------------------
1 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/lib/Pod/t/eol.t b/lib/Pod/t/eol.t

Even if something is deprecated, but still supported, shouldn’t we
continue to test for it, until the deprecated feature is removed?

@p5pRT
Copy link
Author

p5pRT commented Jul 3, 2011

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 3, 2011

From [email protected]

Even if something is deprecated, but still supported, shouldn’t we
continue to test for it, until the deprecated feature is removed?

Sorry, it is not supported any more either. I discussed this issue on #p5p
but I cannot find the logs to prove it.

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2011

From @cpansprout

On Sun Jul 03 14​:41​:27 2011, ponguile@​gmail.com wrote​:

Even if something is deprecated, but still supported, shouldn’t we
continue to test for it, until the deprecated feature is removed?

Sorry, it is not supported any more either. I discussed this issue
on #p5p
but I cannot find the logs to prove it.

Then how are the tests currently passing? I’m confused.

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2011

From [email protected]

______________________________________
From​: Father Chrysostomos via RT [perlbug-followup@​perl.org]
Sent​: Sunday, July 03, 2011 9​:48 PM
To​: Green, Marc Evan
Subject​: [perl #93878] [PATCH] eol.t​: Don't test for CR as line separator as that is deprecated

On Sun Jul 03 14​:41​:27 2011, ponguile@​gmail.com wrote​:

Even if something is deprecated, but still supported, shouldn’t we
continue to test for it, until the deprecated feature is removed?

Sorry, it is not supported any more either. I discussed this issue
on #p5p
but I cannot find the logs to prove it.

Then how are the tests currently passing? I’m confused.

The tests use Pod​::Html which *does* technically support '\r' as a line separator -- it does a global s/\r/\n/ -- but pjcj enlightened me that that behavior is no longer supported (see below). Note that I am currently refactoring Pod​::Html and it no longer will support \r as a line separator.

Jun 30 18​:42​:37 <marcg> a question about lib/Pod/t/eol.t​: why should '\r' be treated as a newline?
Jun 30 18​:42​:52 <marcg> I understand why \r\n is, but why just \r?
Jun 30 18​:43​:14 <claes> marcg​: macos classic used that as line separator
Jun 30 18​:43​:50 <marcg> thanks claes
Jun 30 18​:43​:58 <pjcj> but we don't support that any more, and I don't think anything else uses it
Jun 30 19​:08​:45 <marcg> pjcj, so can I remove that part of the test?
Jun 30 19​:09​:56 <pjcj> I would imagine so, but it's hard to be sure
Jun 30 19​:10​:14 <pjcj> asking on the list, possibly with your patch, might be wise

@p5pRT
Copy link
Author

p5pRT commented Jul 10, 2011

From @cpansprout

On Mon Jul 04 06​:25​:49 2011, marcgreen@​WPI.EDU wrote​:

______________________________________
From​: Father Chrysostomos via RT [perlbug-followup@​perl.org]
Sent​: Sunday, July 03, 2011 9​:48 PM
To​: Green, Marc Evan
Subject​: [perl #93878] [PATCH] eol.t​: Don't test for CR as line
separator as that is deprecated

On Sun Jul 03 14​:41​:27 2011, ponguile@​gmail.com wrote​:

Even if something is deprecated, but still supported, shouldn’t we
continue to test for it, until the deprecated feature is removed?

Sorry, it is not supported any more either. I discussed this issue
on #p5p
but I cannot find the logs to prove it.

Then how are the tests currently passing? I’m confused.

The tests use Pod​::Html which *does* technically support '\r' as a
line separator -- it does a global s/\r/\n/ -- but pjcj enlightened
me that that behavior is no longer supported (see below). Note that
I am currently refactoring Pod​::Html and it no longer will support
\r as a line separator.

Jun 30 18​:42​:37 <marcg> a question about lib/Pod/t/eol.t​: why should
'\r' be treated as a newline?
Jun 30 18​:42​:52 <marcg> I understand why \r\n is, but why just \r?
Jun 30 18​:43​:14 <claes> marcg​: macos classic used that as line
separator
Jun 30 18​:43​:50 <marcg> thanks claes
Jun 30 18​:43​:58 <pjcj> but we don't support that any more, and I don't
think anything else uses it
Jun 30 19​:08​:45 <marcg> pjcj, so can I remove that part of the test?
Jun 30 19​:09​:56 <pjcj> I would imagine so, but it's hard to be sure
Jun 30 19​:10​:14 <pjcj> asking on the list, possibly with your patch,
might be wise

Oh no, not this again. :-(

The ability to run perl on a platform that uses \r as its default line
separator is orthogonal to the ability to process files that might have
originated on such a platform.

Furthermore, there are still Mac OS X programs that use \r as the line
separator.

So, no, I do not think Pod​::Html should drop support for it. Why does it
need to? Is it because Pod​::Simple does not support it? If not, why not?
If that was removed at some point, I think it should be reinstated.

@p5pRT
Copy link
Author

p5pRT commented Sep 17, 2011

@cpansprout - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant