Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 113294
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.44_001
Fixed in: 1.45



Subject: uniq() implementation breaks LMU test
(copied from https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/28) @leonerd The implementation of uniq() as present in the latest devel 1.44_001 fails a test in this PR: # Failed test 'none of the numbers in the array were stringified by uniq' # at t/uniq.t line 44. # Failed test 'uniq uniquifies mixed numbers and strings correctly in a tied array' # at t/uniq.t line 58. # Structures begin differing at: # $got->[1] = Does not exist # $expected->[1] = '2'
Hmmm.. Hard to say what's the best thing to do with those failures. The first of them (about not stringifying) tests the very fragile property of the SvPOK flag on elements of the input list. That flag is an internal-representation detail and I don't feel is the sort of thing worth worrying about. For example, simply interpolating elements into an array to print it would side-effect that flag on (think print STDERR "Debug: values are <@values>\n"; ) The tied array test looks potentially interesting though. Perhaps some missing magic calls in my implementation. I'll take a look. -- Paul Evans
On Wed Mar 23 12:56:12 2016, PEVANS wrote: Show quoted text
> The tied array test looks potentially interesting though. Perhaps some > missing magic calls in my implementation. I'll take a look.
Indeed so. And now fixed https://github.com/Scalar-List-Utils/Scalar-List-Utils/commit/6e915c0c2964c97eee10aa490d9c4c7f79975a51 and a similar trick also fixes the 1.44 documented "issue" of multiple GET magics for uniqnum() https://github.com/Scalar-List-Utils/Scalar-List-Utils/commit/fad9db1ff098a6cf44c055c8b4b23a96ca8c509a I'll call this 1.44_002 and if that pleases the court that can become 1.45 -- Paul Evans
Released in 1.45 -- Paul Evans