Skip Menu |

This queue is for tickets about the Set-Object CPAN distribution.

Report information
The Basics
Id: 24965
Status: resolved
Priority: 0/
Queue: Set-Object

People
Owner: Nobody in particular
Requestors: nigel.metheringham [...] Dev.intechnology.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.19
Fixed in:
  • 1.20
  • 1.21
  • 1.22
  • 1.23
  • 1.24
  • 1.25



Subject: compare() of 2 empty sets returns disjoint (rather then equal)
One liner demonstration:- perl -MSet::Object -e '$a=Set::Object->new();print $a->compare($a),"\n"' This outputs disjoint Failing test and patch to follow
From: nigel.metheringham [...] Dev.intechnology.co.uk
Failing test attached
# This is a patch for Set-Object-1.19.orig to update it to Set-Object-1.19 # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -c 'Set-Object-1.19.orig/t/scalar/compare.t' 'Set-Object-1.19/t/scalar/compare.t' Index: ./t/scalar/compare.t *** ./t/scalar/compare.t Thu Nov 17 21:08:51 2005 --- ./t/scalar/compare.t Thu Feb 15 10:37:31 2007 *************** *** 10,16 **** my $n = Set::Object->new(qw()); my $o = Set::Object->new(qw()); ! print "1..23\n"; print "not " unless $t == $u; print "ok 1\n"; --- 10,16 ---- my $n = Set::Object->new(qw()); my $o = Set::Object->new(qw()); ! print "1..24\n"; print "not " unless $t == $u; print "ok 1\n"; *************** *** 85,90 **** --- 85,94 ---- print "ok 23\n"; } + # [cpan #24965] + print "not " unless $n->compare($o) eq 'equal'; + print "ok 24\n"; + sub show { my $z = shift; #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Thu Feb 15 10:40:51 2007 # Generated by : makepatch 2.03 # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p 't/scalar/compare.t' 1765 1171535851 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Thu Feb 15 10:40:51 2007] #### #### Patch checksum: 68 2004 55222 #### #### Checksum: 86 2700 47283 ####
From: nigel.metheringham [...] Dev.intechnology.co.uk
Patch to fix
# This is a patch for Set-Object-1.19 to update it to Set-Object-1.19.new # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -u 'Set-Object-1.19/lib/Set/Object.pm' 'Set-Object-1.19.new/lib/Set/Object.pm' Index: ./lib/Set/Object.pm --- ./lib/Set/Object.pm Tue Jan 23 00:58:45 2007 +++ ./lib/Set/Object.pm Thu Feb 15 10:51:42 2007 @@ -959,7 +959,12 @@ } } } else { - return "disjoint"; + if ($self->size || $other->size) { + return "disjoint"; + } else { + # both sets are empty + return "equal"; + } } } #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Thu Feb 15 10:53:49 2007 # Generated by : makepatch 2.03 # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p 'lib/Set/Object.pm' 24901 1171536702 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Thu Feb 15 10:53:49 2007] #### #### Patch checksum: 52 1672 33691 #### #### Checksum: 70 2367 25658 ####
Thanks, these changes have been applied (see http://utsl.gen.nz/gitweb/?p=Set-Object;a=commit;h=d9ce9b9) Should be hitting CPAN with documentation fixes as 1.20 RSN.