r23477 - in /branches/upstream/libset-infinite-perl/current: Changes MANIFEST META.yml Makefile.PL lib/Set/Infinite.pm lib/Set/Infinite/Basic.pm t/union.t

ghostbar-guest at users.alioth.debian.org ghostbar-guest at users.alioth.debian.org
Tue Jul 22 04:18:20 UTC 2008


Author: ghostbar-guest
Date: Tue Jul 22 04:18:18 2008
New Revision: 23477

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=23477
Log:
[svn-upgrade] Integrating new upstream version, libset-infinite-perl (0.63)

Added:
    branches/upstream/libset-infinite-perl/current/t/union.t
Modified:
    branches/upstream/libset-infinite-perl/current/Changes
    branches/upstream/libset-infinite-perl/current/MANIFEST
    branches/upstream/libset-infinite-perl/current/META.yml
    branches/upstream/libset-infinite-perl/current/Makefile.PL
    branches/upstream/libset-infinite-perl/current/lib/Set/Infinite.pm
    branches/upstream/libset-infinite-perl/current/lib/Set/Infinite/Basic.pm

Modified: branches/upstream/libset-infinite-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/Changes?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/Changes (original)
+++ branches/upstream/libset-infinite-perl/current/Changes Tue Jul 22 04:18:18 2008
@@ -1,4 +1,11 @@
 Revision history for Perl extension Set::Infinite.
+
+0.63   2008-07-21
+- minor tweak in union(); added tests
+
+0.62   2008-07-20
+- fixed a problem in union() that caused first() to return a wrong result.
+  reported by David Gang 
 
 0.61   2004-11-03
 - some optimization of intersected_spans()

Modified: branches/upstream/libset-infinite-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/MANIFEST?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/MANIFEST (original)
+++ branches/upstream/libset-infinite-perl/current/MANIFEST Tue Jul 22 04:18:18 2008
@@ -23,6 +23,7 @@
 t/select_offset.t
 t/size.t
 t/basic_intersects.t
+t/union.t
 
 META.yml                                Module meta-data (added by MakeMaker)
 

Modified: branches/upstream/libset-infinite-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/META.yml?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/META.yml (original)
+++ branches/upstream/libset-infinite-perl/current/META.yml Tue Jul 22 04:18:18 2008
@@ -1,11 +1,12 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Set-Infinite
-version:      0.61
+version:      0.63
 version_from: lib/Set/Infinite.pm
 installdirs:  site
 requires:
+    Test::More:                    0
     Time::Local:                   0
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30

Modified: branches/upstream/libset-infinite-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/Makefile.PL?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/Makefile.PL (original)
+++ branches/upstream/libset-infinite-perl/current/Makefile.PL Tue Jul 22 04:18:18 2008
@@ -5,11 +5,14 @@
 # the contents of the Makefile that is written.
 WriteMakefile(
     'ABSTRACT'        => 'Infinite Sets math',
-    'AUTHOR'          => 'Flavio Soibelmann Glock - fglock at pucrs.br',
+    'AUTHOR'          => 'Flavio S. Glock <fglock at gmail.com>',
     'NAME'            => 'Set::Infinite',
     'VERSION_FROM'    => 'lib/Set/Infinite.pm',
     'EXCLUDE_EXT'     => [ qw(Makefile gz LOG x~~) ],
-    'PREREQ_PM'       => { 'Time::Local' => 0 },
+    'PREREQ_PM'       => { 
+        'Time::Local'   => 0,
+        'Test::More'    => 0, 
+    },
     'dist'            => { 'COMPRESS' => 'gzip' },
 );
 

Modified: branches/upstream/libset-infinite-perl/current/lib/Set/Infinite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/lib/Set/Infinite.pm?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/lib/Set/Infinite.pm (original)
+++ branches/upstream/libset-infinite-perl/current/lib/Set/Infinite.pm Tue Jul 22 04:18:18 2008
@@ -43,7 +43,7 @@
 
 
 BEGIN {
-    $VERSION = "0.61";
+    $VERSION = "0.63";
     $TRACE = 0;         # enable basic trace method execution
     $DEBUG_BT = 0;      # enable backtrack tracer
     $PRETTY_PRINT = 0;  # 0 = print 'Too Complex'; 1 = describe functions
@@ -1906,7 +1906,7 @@
 
 =head1 AUTHOR
 
-Flavio Soibelmann Glock <fglock at pucrs.br>
+Flavio S. Glock <fglock at gmail.com>
 
 =head1 COPYRIGHT
 

Modified: branches/upstream/libset-infinite-perl/current/lib/Set/Infinite/Basic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/lib/Set/Infinite/Basic.pm?rev=23477&op=diff
==============================================================================
--- branches/upstream/libset-infinite-perl/current/lib/Set/Infinite/Basic.pm (original)
+++ branches/upstream/libset-infinite-perl/current/lib/Set/Infinite/Basic.pm Tue Jul 22 04:18:18 2008
@@ -660,6 +660,7 @@
     }
 
     my @tmp;
+    my $is_real = !$a1->tolerance && !$b1->tolerance;
     B: foreach $ib ($ib .. $#{$b_list}) {
         foreach $ia ($ia .. $#{$a1->{list}}) {
             @tmp = _simple_union($a1->{list}[$ia], $b_list->[$ib], $a1->{tolerance});
@@ -668,7 +669,9 @@
 
                     while (1) {
                         last if $ia >= $#{$a1->{list}};    
-                        last unless _simple_intersects ( $a1->{list}[$ia], $a1->{list}[$ia + 1] );
+                        last unless _simple_intersects ( $a1->{list}[$ia], $a1->{list}[$ia + 1] )
+                            ||    $is_real 
+                               && $a1->{list}[$ia]{b} == $a1->{list}[$ia + 1]{a};
                         @tmp = _simple_union($a1->{list}[$ia], $a1->{list}[$ia + 1], $a1->{tolerance});
                         last unless @tmp == 1;
                         $a1->{list}[$ia] = $tmp[0];
@@ -1146,7 +1149,7 @@
 
 =head1 AUTHOR
 
-    Flavio Soibelmann Glock <fglock at pucrs.br>
+    Flavio S. Glock <fglock at gmail.com>
 
 =cut
 

Added: branches/upstream/libset-infinite-perl/current/t/union.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libset-infinite-perl/current/t/union.t?rev=23477&op=file
==============================================================================
--- branches/upstream/libset-infinite-perl/current/t/union.t (added)
+++ branches/upstream/libset-infinite-perl/current/t/union.t Tue Jul 22 04:18:18 2008
@@ -1,0 +1,46 @@
+
+use strict;
+use warnings;
+use Test::More tests => 4;
+
+use Set::Infinite qw($inf);
+
+my $neg_inf = -$inf;
+
+# $Set::Infinite::TRACE = 1;
+# $Set::Infinite::PRETTY_PRINT = 1;
+
+my $a = 1998; 
+my $b = 2002; 
+my $c = 2004; 
+my $d = 2005; 
+my $e = 1994; 
+
+my $span1 = Set::Infinite->new(
+    {
+        a => $a, open_begin => 0,
+        b => $b, open_end => 1,
+    } 
+);
+my $span2 = Set::Infinite->new(
+    {
+        a => $c, open_begin => 0,
+        b => $d, open_end => 1,
+    } 
+);
+my $span3 = Set::Infinite->new(
+    {
+        a => $e, open_begin => 0,
+        b => $c, open_end => 1,
+    } 
+);
+
+my $set1 = $span1->union( $span2 );
+is( "$set1", "[1998..2002),[2004..2005)", "set 1");
+my $set2 = $span3;
+is( "$set2", "[1994..2004)", "set 2");
+my $set3 = $set1->union($set2);
+is( "$set3", "[1994..2005)", "set 3");
+my $set4 = $set2->union($set1);
+is( "$set4", "[1994..2005)", "set 4");
+




More information about the Pkg-perl-cvs-commits mailing list