r26060 - in /trunk/libset-object-perl: ./ debian/ lib/Set/ lib/Set/Object/ t/object/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Wed Oct 15 17:29:00 UTC 2008
Author: ansgar-guest
Date: Wed Oct 15 17:28:51 2008
New Revision: 26060
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26060
Log:
* New upstream release.
* Refresh debian/rules for debhelper 7.
* Convert debian/copyright to proposed machine-readable format.
Added:
trunk/libset-object-perl/debian/clean
Modified:
trunk/libset-object-perl/Changes.pod
trunk/libset-object-perl/META.yml
trunk/libset-object-perl/Makefile.PL
trunk/libset-object-perl/Object.xs
trunk/libset-object-perl/SIGNATURE
trunk/libset-object-perl/debian/changelog
trunk/libset-object-perl/debian/compat
trunk/libset-object-perl/debian/control
trunk/libset-object-perl/debian/copyright
trunk/libset-object-perl/debian/rules
trunk/libset-object-perl/lib/Set/Object.pm
trunk/libset-object-perl/lib/Set/Object/Weak.pm
trunk/libset-object-perl/t/object/union.t
trunk/libset-object-perl/t/object/weakref.t
Modified: trunk/libset-object-perl/Changes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/Changes.pod?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/Changes.pod (original)
+++ trunk/libset-object-perl/Changes.pod Wed Oct 15 17:28:51 2008
@@ -2,6 +2,28 @@
=encoding utf8
=head1 REVISION HISTORY FOR Set::Object
+
+=head1 1.26, 13 Oct 2008
+
+=over
+
+=item *
+
+Methods which destroyed C<$@> due to internal use of C<eval> now
+properly call C<local($@)> (Yuval)
+
+=item *
+
+Fix a leak and a corner case with weak set magic, and squash some
+warnings (Yuval)
+
+=item *
+
+Define behaviour when dealing with return values from operations on
+weak sets. No longer hard-coded "Set::Object" - may affect
+Set::Object sub-classes (Sam)
+
+=back
=head1 1.25, 22 Jul 2008
Modified: trunk/libset-object-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/META.yml?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/META.yml (original)
+++ trunk/libset-object-perl/META.yml Wed Oct 15 17:28:51 2008
@@ -1,9 +1,10 @@
--- #YAML:1.0
name: Set-Object
-version: 1.25
+version: 1.26
abstract: Unordered collections (sets) of Perl Objects
-license: ~
-author: ~
+license: Artistic
+author:
+ - Jean-Louis Leroy and Sam Vilain
generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
Modified: trunk/libset-object-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/Makefile.PL?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/Makefile.PL (original)
+++ trunk/libset-object-perl/Makefile.PL Wed Oct 15 17:28:51 2008
@@ -11,6 +11,8 @@
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Set::Object',
+ 'AUTHOR' => 'Jean-Louis Leroy and Sam Vilain',
+ 'LICENSE' => 'Artistic',
'VERSION_FROM' => 'lib/Set/Object.pm', # finds $VERSION
'ABSTRACT' => "Unordered collections (sets) of Perl Objects",
'LIBS' => [''], # e.g., '-lm'
Modified: trunk/libset-object-perl/Object.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/Object.xs?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/Object.xs (original)
+++ trunk/libset-object-perl/Object.xs Wed Oct 15 17:28:51 2008
@@ -337,10 +337,12 @@
IF_SPELL_DEBUG(_warn("dispelling magic from 0x%.8x (self = 0x%.8x, mg = 0x%.8x)",
sv, self_svrv, mg));
if (mg) {
- AV* wand = mg->mg_obj;
+ AV* wand = (AV *)mg->mg_obj;
SV ** const svp = AvARRAY(wand);
I32 i = AvFILLp(wand);
int c = 0;
+
+ assert( SvTYPE(want) == SVt_PVAV );
while (i >= 0) {
if (svp[i] && SvIV(svp[i])) {
@@ -381,7 +383,7 @@
}
void
-_fiddle_strength(ISET* s, int strong) {
+_fiddle_strength(ISET* s, const int strong) {
BUCKET* bucket_iter = s->bucket;
BUCKET* bucket_last = bucket_iter + s->buckets;
@@ -405,7 +407,8 @@
SvREFCNT(*el_iter)));
}
else {
- _cast_magic(s, *el_iter);
+ if ( SvREFCNT(*el_iter) > 1 )
+ _cast_magic(s, *el_iter);
SvREFCNT_dec(*el_iter);
IF_DEBUG(_warn("reduced RC of 0x%.8x to %d", *el_iter,
SvREFCNT(*el_iter)));
@@ -463,18 +466,20 @@
mg = _detect_magic(sv);
if (mg) {
IF_SPELL_DEBUG(_warn("sv_magicext reusing wand 0x%.8x for 0x%.8x", wand, sv));
- wand = mg->mg_obj;
+ wand = (AV *)mg->mg_obj;
+ assert( SvTYPE(wand) == SVt_PVAV );
}
else {
wand=newAV();
IF_SPELL_DEBUG(_warn("sv_magicext(0x%.8x, 0x%.8x, %ld, 0x%.8x, NULL, 0)", sv, wand, how, vtable));
#if (PERL_VERSION > 7) || ( (PERL_VERSION == 7)&&( PERL_SUBVERSION > 2) )
- sv_magicext(sv, wand, how, vtable, NULL, 0);
+ mg = sv_magicext(sv, (SV *)wand, how, vtable, NULL, 0);
#else
sv_magic(sv, wand, how, NULL, 0);
mg = mg_find(sv, SET_OBJECT_MAGIC_backref);
mg->mg_virtual = &SET_OBJECT_vtbl_backref;
#endif
+ mg->mg_flags |= MGf_REFCOUNTED;
SvRMAGICAL_on(sv);
}
@@ -488,6 +493,8 @@
if (s == o)
return;
} else {
+ if ( svp[i] ) SvREFCNT_dec(svp[i]);
+ svp[i] = NULL;
free = i;
}
i = i - 1;
@@ -500,6 +507,7 @@
IF_SPELL_DEBUG(_warn("casting self 0x%.8x to slot %d", self_svrv, free));
svp[free] = self_svrv;
}
+
/*
SvREFCNT_inc(self_svrv);
*/
@@ -838,13 +846,16 @@
CODE:
ISET* s = INT2PTR(ISET*, SvIV(SvRV(self)));
- IF_DEBUG(_warn("aargh!"));
- iset_clear(s);
- if (s->flat) {
- hv_undef(s->flat);
- SvREFCNT_dec(s->flat);
- }
- Safefree(s);
+ if ( s ) {
+ sv_setiv(SvRV(self), 0);
+ IF_DEBUG(_warn("aargh!"));
+ iset_clear(s);
+ if (s->flat) {
+ hv_undef(s->flat);
+ SvREFCNT_dec(s->flat);
+ }
+ Safefree(s);
+ }
int
is_weak(self)
@@ -867,7 +878,7 @@
if (s->is_weak)
XSRETURN_UNDEF;
- IF_DEBUG(_warn("weakening set (0x%.8x)", SvRV(self)));
+ IF_DEBUG(_warn("weakening set (0x%.8x)", SvRV(self)));
s->is_weak = SvRV(self);
@@ -964,14 +975,14 @@
CODE:
ISET* s = INT2PTR(ISET*, SvIV(SvRV(sv)));
if (s->flat) {
- RETVAL = newRV_inc(s->flat);
+ RETVAL = newRV_inc((SV *)s->flat);
} else {
XSRETURN_UNDEF;
}
OUTPUT:
RETVAL
-char *
+const char *
blessed(sv)
SV * sv
PROTOTYPE: $
@@ -987,7 +998,7 @@
OUTPUT:
RETVAL
-char *
+const char *
reftype(sv)
SV * sv
PROTOTYPE: $
Modified: trunk/libset-object-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/SIGNATURE?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/SIGNATURE (original)
+++ trunk/libset-object-perl/SIGNATURE Wed Oct 15 17:28:51 2008
@@ -14,24 +14,18 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 3048464c1581d609a070aa8301c75b3d811bf606 Changes.pod
-SHA1 a183196335c39361a7030b1bf55b2a137ea883c8 MANIFEST
-SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 META.yml
-SHA1 a88f349740616e083df4553bd1c592fb6ec68dcd Makefile.PL
-SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 Object.bs
-SHA1 1bff9af534230f8114e9b4b9eaa508b79b46f9f0 Object.c
-SHA1 4eb8ea0bf64e09e30ed7aaf47a4335849c00457b Object.o
-SHA1 9a3435e38c125fe0ddae8fddf77ff07b73580770 Object.xs
+SHA1 6f6095fe820326aaad9446165514fc76906e5d03 Changes.pod
+SHA1 816639c05c69373b63a93333c3e7e60a87866e56 MANIFEST
+SHA1 c826cfdec5efc768c4a6eaec8d690b4f309c03d0 Makefile.PL
+SHA1 c7e94daaee60472be79ff69104d2b18d1b7fe2a3 Object.xs
SHA1 c2c4506b0563e59dd930ccb513e5a5fc5b2a1f70 README
-SHA1 f7d5300f8ec1d6b0e1bab4bee7a0c8e32680e6bb Set-Object-1.22.tar
-SHA1 9a7aadf8498a58001b3ba1b1747bdaa265a21530 lib/Set/Object.pm
-SHA1 ed61f9e9e845796a72d1338544eec8e05157fe1f lib/Set/Object/Weak.pm
-SHA1 b005f8fc4c2610e45f9ae19d6b8141e07c665cfb ppport.h
+SHA1 e04c3d0688bca4ddbc3d445328170de3bf7c97b3 lib/Set/Object.pm
+SHA1 3ee3d2b72d4130ed27f8d24a2625fa22895e52ca lib/Set/Object/Weak.pm
+SHA1 f04d25338c1e35bda69ac5eda0bc672e10ca5b6f ppport.h
SHA1 213b597a69c1f909d585a14a6a094a25c3e684af t/ingy/arrayref.t
SHA1 db433f58da0fbecc971da5815ef5a530cd7f59f4 t/misc/leaks.t
SHA1 4a159d3dccb6918ec790905d0e2bec3e58db15e9 t/misc/pod.t
SHA1 dfb47bc536bc8bface7f95144e4985dd79447977 t/misc/pod_coverage.t
-SHA1 70f9b68b285bab7a8415392e9fab2a25b30267c3 t/misc/threads.t
SHA1 494c2f3a77ce211ffcbedc5e44dd8a6454764fe2 t/misc/undef.t
SHA1 018c38db837777290619ec16a5f1c0dd5783263a t/object/Person.pm
SHA1 40b4a7db1302cbd1d9b57e23508209818c8542dc t/object/Saint.pm
@@ -52,8 +46,8 @@
SHA1 35a2ea64d0f939557f15c4e55f22715ebe5dafaf t/object/storable.t
SHA1 479a9f5cd91b03a7ef37a833886c54e8e19c18cd t/object/subsuper.t
SHA1 d18eaba2928ec2aa58a09feb70e49aad7d05e3f6 t/object/symmetric_difference.t
-SHA1 5d0eb7c8022f69119b05c26f0fed06c83e088a7f t/object/union.t
-SHA1 db1cfa2c673150e51adc99f9e6c34cea158bb373 t/object/weakref.t
+SHA1 f96b691a78eb18bc85739b6b0c4b45d2208b2669 t/object/union.t
+SHA1 eebb5dae0215a01ec427abafac502d534c20d524 t/object/weakref.t
SHA1 85b0418c45937ccfc37694fc0463617d9d926261 t/scalar/basic.t
SHA1 547133fca61d8af7abfd6774be681f65b48ca43e t/scalar/basic_overload.t
SHA1 b3b8d494ae6e7b875a424110425d6c55d6676fdc t/scalar/boolean.t
@@ -74,7 +68,7 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-iEYEARECAAYFAkh/+90ACgkQ/AZAiGayWEOR2wCeJLrfk+lFLMelEwF3v2pE3CA8
-TO4An0/Ir5VGkSA+qrJEWhReUn25fZBJ
-=ZGbA
+iEYEARECAAYFAkjyaoUACgkQ/AZAiGayWEMzZACgzA0Y4+tZWxjK9xaO4q+Uur3C
+hBEAnRloSudJLKVGlfrWvEu5McFpRYMX
+=Ro6e
-----END PGP SIGNATURE-----
Modified: trunk/libset-object-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/changelog?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/debian/changelog (original)
+++ trunk/libset-object-perl/debian/changelog Wed Oct 15 17:28:51 2008
@@ -1,3 +1,11 @@
+libset-object-perl (1.26-1) unstable; urgency=low
+
+ * New upstream release.
+ * Refresh debian/rules for debhelper 7.
+ * Convert debian/copyright to proposed machine-readable format.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Wed, 15 Oct 2008 19:28:10 +0200
+
libset-object-perl (1.25-1) unstable; urgency=low
[ Ansgar Burchardt ]
Added: trunk/libset-object-perl/debian/clean
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/clean?rev=26060&op=file
==============================================================================
--- trunk/libset-object-perl/debian/clean (added)
+++ trunk/libset-object-perl/debian/clean Wed Oct 15 17:28:51 2008
@@ -1,0 +1,2 @@
+CHANGES
+
Modified: trunk/libset-object-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/compat?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/debian/compat (original)
+++ trunk/libset-object-perl/debian/compat Wed Oct 15 17:28:51 2008
@@ -1,1 +1,1 @@
-6
+7
Modified: trunk/libset-object-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/control?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/debian/control (original)
+++ trunk/libset-object-perl/debian/control Wed Oct 15 17:28:51 2008
@@ -11,7 +11,7 @@
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libset-object-perl/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/
Homepage: http://search.cpan.org/dist/Set-Object/
-Build-Depends: debhelper (>= 6), perl (>> 5.8.1), libtest-pod-perl,
+Build-Depends: debhelper (>= 7), perl (>> 5.8.1), libtest-pod-perl,
libtest-pod-coverage-perl
Package: libset-object-perl
Modified: trunk/libset-object-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/copyright?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/debian/copyright (original)
+++ trunk/libset-object-perl/debian/copyright Wed Oct 15 17:28:51 2008
@@ -1,41 +1,39 @@
-This is the Debian GNU/Linux version of the Set::Object Perl module.
-This module is available via CPAN network:
-http://search.cpan.org/dist/Set-Object/
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=228
+Upstream-Name: Set-Object
+Upstream-Maintainer: Sam Vilain
+Upstream-Source: http://search.cpan.org/dist/Set-Object/
-Copyright/License:
+Files: *
+Copyright:
+ © 1998-1999, Jean-Louis Leroy
+ © 2003-2005, Sam Vilain
+ © 2006-2007, Catalyst IT (NZ) Limited
+License: Artistic
+ This module is free software. It may be used, redistributed and/or modified
+ under the terms of the Perl Artistic License.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic Licence
+ can be found in `/usr/share/common-licenses/Artistic'.
- Copyright (c) 1998-1999, Jean-Louis Leroy. All Rights Reserved.
- This module is free software. It may be used, redistributed
- and/or modified under the terms of the Perl Artistic License
+Files: ppport.h
+Copyright:
+ © 1999, Kenneth Albanowski
+ © 2001, Paul Marquess
+ © 2004-2007, Marcus Holland-Moritz
+Licesnse: GPL-1+ | Artistic
+ This program is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+ .
+ Perl is distributed under your choice of the GNU General Public License or
+ the Artistic License. On Debian GNU/Linux systems, the complete text of the
+ GNU General Public License can be found in `/usr/share/common-licenses/GPL'
+ and the Artistic Licence in `/usr/share/common-licenses/Artistic'.
- Portions Copyright (c) 2003 - 2005, Sam Vilain. Same license.
+Files: debian/*
+Copyright:
+ © 2001-2002, Stephen Zander <gibreel at debian.org>
+ © 2008, Ansgar Burchardt <ansgar at 43-1.org>
+License: Artistic
+ It is assumed that all contributors put their work under the same license
+ as the module itself.
- Portions Copyright (c) 2006, 2007, Catalyst IT (NZ) Limited. Same
- license.
-
- The full text of the Artistic Licence is available on Debian systems in
- /usr/share/common-licenses/Artistic.
-
-
-Info for others copyright holders:
-
- ppport.h:
-
- Version 3.x, Copyright (c) 2004-2007, Marcus Holland-Moritz.
- Version 2.x, Copyright (C) 2001, Paul Marquess.
- Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
-
- This program is free software; you can redistribute it and/or
- modify it under the same terms as Perl itself.
-
- Perl is distributed under your choice of the GNU General Public License or
- the Artistic License. On Debian GNU/Linux systems, the complete text of the
- GNU General Public License can be found in `/usr/share/common-licenses/GPL'
- and the Artistic Licence in `/usr/share/common-licenses/Artistic'.
-
-
-This package has been through multiple maintainers (for a list see
-/usr/share/doc/libset-object-perl/changelog.Debian.gz).
-
-Current Debian specific changes are
-copyright (c) 2001-2002, Stephen Zander <gibreel at debian.org>.
Modified: trunk/libset-object-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/debian/rules?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/debian/rules (original)
+++ trunk/libset-object-perl/debian/rules Wed Oct 15 17:28:51 2008
@@ -1,74 +1,24 @@
#!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PERL ?= /usr/bin/perl
-PACKAGE = $(shell dh_listpackages)
-TMP = $(CURDIR)/debian/$(PACKAGE)
-
-# Allow disabling build optimisation by setting noopt in
-# $DEB_BUILD_OPTIONS
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
build: build-stamp
build-stamp:
- dh_testdir
- $(PERL) Makefile.PL INSTALLDIRS=vendor
- $(MAKE) OPTIMIZE="$(CFLAGS)" LD_RUN_PATH=""
- pod2text Changes.pod > debian/changelog_generated.txt
- $(MAKE) test
+ dh build
+ pod2text Changes.pod > CHANGES
touch $@
clean:
- dh_testdir
- dh_testroot
- dh_clean build-stamp install-stamp debian/changelog_generated.txt
- [ ! -f Makefile ] || $(MAKE) realclean
+ dh $@
install: install-stamp
install-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_clean -k
- $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
- [ ! -d $(TMP)/usr/share/perl5 ] || \
- rmdir --ignore-fail-on-non-empty --parents --verbose \
- $(TMP)/usr/share/perl5
+ dh install
touch $@
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do here for an architecture-dependent package
+binary-arch: install
+ dh $@
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installdocs
- dh_installchangelogs debian/changelog_generated.txt
- dh_shlibdeps
- dh_strip
- dh_perl
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+binary-indep:
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+binary: binary-arch binary-indep
+
+.PHONY: binary binary-arch binary-indep install clean build
Modified: trunk/libset-object-perl/lib/Set/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/lib/Set/Object.pm?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/lib/Set/Object.pm (original)
+++ trunk/libset-object-perl/lib/Set/Object.pm Wed Oct 15 17:28:51 2008
@@ -509,7 +509,7 @@
@EXPORT_OK = qw( ish_int is_int is_string is_double blessed reftype
refaddr is_overloaded is_object is_key set weak_set );
-$VERSION = '1.25';
+$VERSION = '1.26';
bootstrap Set::Object $VERSION;
@@ -898,6 +898,7 @@
# to be an array index, and if so returns the index
sub ish_int {
my $i;
+ local $@;
eval { $i = _ish_int($_[0]) };
if ($@) {
@@ -1074,6 +1075,7 @@
}
sub set {
+ local $@;
if (eval { $_[0]->isa(__PACKAGE__) }) {
shift;
}
Modified: trunk/libset-object-perl/lib/Set/Object/Weak.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/lib/Set/Object/Weak.pm?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/lib/Set/Object/Weak.pm (original)
+++ trunk/libset-object-perl/lib/Set/Object/Weak.pm Wed Oct 15 17:28:51 2008
@@ -82,7 +82,7 @@
sub set {
my $class = __PACKAGE__;
if (blessed $_[0] and $_[0]->isa("Set::Object")) {
- $class = "Set::Object";
+ $class = (shift)->strong_pkg;
}
$class->new(@_);
}
Modified: trunk/libset-object-perl/t/object/union.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/t/object/union.t?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/t/object/union.t (original)
+++ trunk/libset-object-perl/t/object/union.t Wed Oct 15 17:28:51 2008
@@ -1,28 +1,25 @@
use Set::Object;
+
+use Test::More tests => 10;
require 't/object/Person.pm';
package Person;
populate();
-$simpsons = Set::Object->new($homer, $marge);
-$bouviers = Set::Object->new($marge, $patty, $selma);
-$both = Set::Object->new($homer, $marge, $patty, $selma);
-$empty = Set::Object->new;
+foreach my $class ( qw(Set::Object Set::Object::Weak) ) {
+ $simpsons = $class->new($homer, $marge);
+ $bouviers = $class->new($marge, $patty, $selma);
+ $both = $class->new($homer, $marge, $patty, $selma);
+ $empty = $class->new;
-print "1..5\n";
+ ::ok( $simpsons->union($bouviers) == $both, "union method" );
-print 'not ' unless $simpsons->union($bouviers) == $both;
-print "ok 1\n";
+ ::ok( $simpsons + $bouviers == $both, "op_union" );
-print 'not ' unless $simpsons + $bouviers == $both;
-print "ok 2\n";
+ ::ok( $bouviers + $simpsons == $both, "op union with ops reversed" );
-print 'not ' unless $bouviers + $simpsons == $both;
-print "ok 3\n";
+ ::ok( $simpsons + $simpsons == $simpsons, "union with self" );
-print 'not ' unless $simpsons + $simpsons == $simpsons;
-print "ok 4\n";
-
-print 'not ' unless $simpsons + $empty == $simpsons;
-print "ok 5\n";
+ ::ok( $simpsons + $empty == $simpsons, "union with empty set" );
+}
Modified: trunk/libset-object-perl/t/object/weakref.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-object-perl/t/object/weakref.t?rev=26060&op=diff
==============================================================================
--- trunk/libset-object-perl/t/object/weakref.t (original)
+++ trunk/libset-object-perl/t/object/weakref.t Wed Oct 15 17:28:51 2008
@@ -1,6 +1,6 @@
# -*- perl -*-
-use Test::More tests => 37;
+use Test::More qw(no_plan);
use Set::Object qw(set refaddr);
use strict;
@@ -197,3 +197,6 @@
each %{$_[0]};
}
}
+
+$set = Set::Object::weak_set(["ø"]) + Set::Object::weak_set(["þ"]);
+is($set->size(), 2, "computations on sets don't care that they're weak");
More information about the Pkg-perl-cvs-commits
mailing list