Skip Menu |

This queue is for tickets about the Text-Quote CPAN distribution.

Report information
The Basics
Id: 97340
Status: open
Priority: 0/
Queue: Text-Quote

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.32
Fixed in: (no value)



Subject: Fails on nvsize!=8 due to string comparison on floating point number
As per subject. Sample fail report: http://www.cpantesters.org/cpan/report/44102423 The float being compared is 0.666666666666666667 vs. 0.666666666666667 Maybe you want to deploy Test::Number::Delta for the test, it provides a convenient interface. Or you avoid floats. Kind Regards from Berlin, (Disclaimer: this was discovered by statistical analysis, I'm not speaking as a user)
Attached is a patch and release zip w/patch applied to fix this prob. An oddity I noted is described below as noted on the module-authors list: I'm not entirely sure what all the test was to do, and found some logical, but questionable behavior, in-as-much as when it shows what it found, the message shows quotes stripped off, but not in the "expected text", i.e. 0.667 doesn't compare as equal to '0.667' in the test. Is that correct? In the test source, I initially had '0.667' (with a few extra 6's) in both places and it didn't compare because the source location was dequoted on being read into memory. That's why I used the "q(0.667)" double quoting, but it seemed a bit clunky if users are expected to do or need double-quoting (this feels like a shell script though I'm sure it would be worse). Anyway, I just needed the test to pass comparing the two floats - as strings, but having to jump through extra quoting steps felt a bit less than str8-forward.
Subject: Text-Quote-0.33.tar.gz
Download Text-Quote-0.33.tar.gz
application/x-gzip 20.4k

Message body not shown because it is not plain text.

Subject: Text-Quote32_33.diff
diff -ru Text-Quote-0.32-2/Changes /tmp/Text-Quote-0.33/Changes --- Text-Quote-0.32-2/Changes 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/Changes 2020-03-21 11:31:32.345989836 -0700 @@ -1,5 +1,12 @@ Revision history for Perl module Text::Quote +0.33 2020-03-21 LAWALSH + - test compares text output 2/3 -- different depending on #float bits. + instead, since we are not testing division, use exact float number + we expect : '0.666666666666667'; (14 sixes) as a quoted string (so + no math precision diffs can make a difference. Likely not best + solution, but seems to be most str8 forward one. + 0.32 2014-06-28 NEILB - Doh, the test for regexp serialization format clearly needs to check what version of Perl it's running under, and change expectations diff -ru Text-Quote-0.32-2/META.yml /tmp/Text-Quote-0.33/META.yml --- Text-Quote-0.32-2/META.yml 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/META.yml 2020-03-21 11:42:47.851817355 -0700 @@ -26,4 +26,4 @@ resources: homepage: https://github.com/neilbowers/Text-Quote repository: https://github.com/neilbowers/Text-Quote.git -version: '0.32' +version: '0.33' diff -ru Text-Quote-0.32-2/Makefile.PL /tmp/Text-Quote-0.33/Makefile.PL --- Text-Quote-0.32-2/Makefile.PL 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/Makefile.PL 2020-03-21 11:42:07.323628308 -0700 @@ -32,7 +32,7 @@ "Test::More" => 0, "vars" => 0 }, - "VERSION" => "0.32", + "VERSION" => "0.33", "test" => { "TESTS" => "t/*.t" } Only in /tmp/Text-Quote-0.33: Makefile.old diff -ru Text-Quote-0.32-2/README /tmp/Text-Quote-0.33/README --- Text-Quote-0.32-2/README 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/README 2020-03-21 11:45:02.587769880 -0700 @@ -1,7 +1,7 @@ This archive contains the distribution Text-Quote, -version 0.32: +version 0.33: Quotes strings as required for perl to eval them back correctly diff -ru Text-Quote-0.32-2/dist.ini /tmp/Text-Quote-0.33/dist.ini --- Text-Quote-0.32-2/dist.ini 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/dist.ini 2020-03-21 11:41:28.891500693 -0700 @@ -4,7 +4,7 @@ copyright_holder = Yves Orton copyright_year = 2002 -version = 0.32 +version = 0.33 [@Basic] [PkgVersion] diff -ru Text-Quote-0.32-2/lib/Text/Quote.pm /tmp/Text-Quote-0.33/lib/Text/Quote.pm --- Text-Quote-0.32-2/lib/Text/Quote.pm 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/lib/Text/Quote.pm 2020-03-21 11:32:34.794823678 -0700 @@ -1,5 +1,5 @@ package Text::Quote; -$Text::Quote::VERSION = '0.32'; +$Text::Quote::VERSION = '0.33'; use 5.006; use strict; use warnings; diff -ru Text-Quote-0.32-2/t/quote.t /tmp/Text-Quote-0.33/t/quote.t --- Text-Quote-0.32-2/t/quote.t 2014-06-28 00:23:56.000000000 -0700 +++ /tmp/Text-Quote-0.33/t/quote.t 2020-03-21 11:40:04.092012416 -0700 @@ -111,7 +111,7 @@ my @quotes=map{Text::Quote->quote($_,indent=>6,col_width=>60)}('"The time has come" the walrus said, "to speak of many things..."',"\0\1\2\3\4\5\6\a\b\t\n\13\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\e\34\35". - "\36\37",("\6\a\b\t\n\13\f\r\32\e\34" x 5),2/3,10,'£20','00',); + "\36\37",("\6\a\b\t\n\13\f\r\32\e\34" x 5),'q(0.666666666666667)',10,'£20','00',); my $res; for my $i (1..@quotes) { $res.= "\$var$i=".$quotes[$i-1].";\n"; @@ -122,7 +122,7 @@ $var2="\0\1\2\3\4\5\6\a\b\t\n\13\f\r\16\17\20\21\22\23\24\25\26\27". "\30\31\32\e\34\35\36\37"; $var3=("\6\a\b\t\n\13\f\r\32\e\34" x 5); -$var4=0.666666666666667; +$var4='q(0.666666666666667)'; $var5=10; $var6='£20'; $var7='00';