r883 - in packages/libset-object-perl/branches/upstream/current/t: . object

Gunnar Wolf gwolf@costa.debian.org
Tue, 05 Apr 2005 22:40:03 +0000


Author: gwolf
Date: 2005-04-05 22:40:02 +0000 (Tue, 05 Apr 2005)
New Revision: 883

Added:
   packages/libset-object-perl/branches/upstream/current/t/object/
   packages/libset-object-perl/branches/upstream/current/t/object/Person.pm
   packages/libset-object-perl/branches/upstream/current/t/object/Saint.pm
   packages/libset-object-perl/branches/upstream/current/t/object/abuse.t
   packages/libset-object-perl/branches/upstream/current/t/object/clear.t
   packages/libset-object-perl/branches/upstream/current/t/object/difference.t
   packages/libset-object-perl/branches/upstream/current/t/object/equal.t
   packages/libset-object-perl/branches/upstream/current/t/object/flags.t
   packages/libset-object-perl/branches/upstream/current/t/object/includes.t
   packages/libset-object-perl/branches/upstream/current/t/object/insert.t
   packages/libset-object-perl/branches/upstream/current/t/object/intersection.t
   packages/libset-object-perl/branches/upstream/current/t/object/members.t
   packages/libset-object-perl/branches/upstream/current/t/object/properties.t
   packages/libset-object-perl/branches/upstream/current/t/object/refcount.t
   packages/libset-object-perl/branches/upstream/current/t/object/remove.t
   packages/libset-object-perl/branches/upstream/current/t/object/storable.t
   packages/libset-object-perl/branches/upstream/current/t/object/subsuper.t
   packages/libset-object-perl/branches/upstream/current/t/object/symmetric_difference.t
   packages/libset-object-perl/branches/upstream/current/t/object/union.t
Removed:
   packages/libset-object-perl/branches/upstream/current/t/Person.pm
   packages/libset-object-perl/branches/upstream/current/t/Saint.pm
   packages/libset-object-perl/branches/upstream/current/t/abuse.t
   packages/libset-object-perl/branches/upstream/current/t/clear.t
   packages/libset-object-perl/branches/upstream/current/t/difference.t
   packages/libset-object-perl/branches/upstream/current/t/equal.t
   packages/libset-object-perl/branches/upstream/current/t/flags.t
   packages/libset-object-perl/branches/upstream/current/t/includes.t
   packages/libset-object-perl/branches/upstream/current/t/insert.t
   packages/libset-object-perl/branches/upstream/current/t/intersection.t
   packages/libset-object-perl/branches/upstream/current/t/members.t
   packages/libset-object-perl/branches/upstream/current/t/properties.t
   packages/libset-object-perl/branches/upstream/current/t/refcount.t
   packages/libset-object-perl/branches/upstream/current/t/remove.t
   packages/libset-object-perl/branches/upstream/current/t/storable.t
   packages/libset-object-perl/branches/upstream/current/t/subsuper.t
   packages/libset-object-perl/branches/upstream/current/t/symmetric_difference.t
   packages/libset-object-perl/branches/upstream/current/t/union.t
Log:
To prepare to load /tmp/tmp.ay7Bng/libset-object-perl-1.10 into
packages/libset-object-perl/branches/upstream/current, perform 18
renames.

*
  packages/libset-object-perl/branches/upstream/current/t/object/abuse.
  t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/abuse.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/Person
  .pm: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/Person.pm.
*
  packages/libset-object-perl/branches/upstream/current/t/object/Saint.
  pm: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/Saint.pm.
*
  packages/libset-object-perl/branches/upstream/current/t/object/union.
  t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/union.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/clear.
  t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/clear.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/differ
  ence.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/difference.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/equal.
  t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/equal.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/flags.
  t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/flags.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/includ
  es.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/includes.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/insert
  .t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/insert.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/inters
  ection.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/intersection.
  t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/member
  s.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/members.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/proper
  ties.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/properties.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/refcou
  nt.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/refcount.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/remove
  .t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/remove.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/storab
  le.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/storable.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/subsup
  er.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/subsuper.t.
*
  packages/libset-object-perl/branches/upstream/current/t/object/symmet
  ric_difference.t: Renamed from
  packages/libset-object-perl/branches/upstream/current/t/symmetric_dif
  ference.t.


Deleted: packages/libset-object-perl/branches/upstream/current/t/Person.pm
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/Person.pm	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/Person.pm	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,94 +0,0 @@
-
-package Person;
-
-use overload
-	'""' => 'stringify',
-	'==' => 'equals',
-	'!=' => 'notequals',
-	fallback => 1;
-
-sub new
-{
-   ++$n;
-   my $type = shift;
-   my $self = bless { @_ }, $type;
-   return $self;
-}
-
-sub DESTROY
-{
-   --$n;
-}
-
-sub populate
-{
-   no strict 'vars';
-   
-   $homer = new Person( firstname => 'Homer', name => 'Simpson' );
-   $marge = new Person( firstname => 'Marge', name => 'Simpson' );
-   $bart = new Person( firstname => 'Bart', name => 'Simpson' );
-   $lisa = new Person( firstname => 'Lisa', name => 'Simpson' );
-   $maggie = new Person( firstname => 'Maggie', name => 'Simpson' );
-
-   @simpsons = ($homer, $marge, $bart, $lisa, $maggie);
-
-   $burns = new Person( firstname => 'Montgomery', name => 'Burns' );
-   $skinner = new Person( firstname => 'Seymour', name => 'Skinner' );
-
-   $patty = new Person( firstname => 'Patty', name => 'Bouvier' );
-   $selma = new Person( firstname => 'Selma', name => 'Bouvier' );
-
-   $n;
-}
-
-sub exterminate
-{
-   no strict 'vars';
-   
-   undef $homer;
-   undef $marge;
-   undef $bart;
-   undef $lisa;
-   undef $maggie;
-
-   undef @simpsons;
-
-   undef $burns;
-   undef $skinner;
-
-   undef $patty;
-   undef $selma;
-
-   $n;
-}
-
-sub same
-{
-   my ($l1, $l2) = @_;
-   my @l1 = sort { $a->{firstname} cmp $b->{firstname} } @$l1;
-   my @l2 = sort { $a->{firstname} cmp $b->{firstname} } @$l2;
-   foreach (@l1) { return 'not ' unless $_ eq shift @l2 }
-   '';
-}
-
-sub stringify
-{
-   my $self = shift;
-
-   return "$self->{firstname} $self->{name}";
-}
-
-sub equals
-{
-   my $a = shift;
-   my $b = shift;
-
-   return ( $a->{firstname} eq $b->{firstname} &&
-   	         $a->{name} eq $b->{name}         )
-}
-
-sub notequals {
-    !equals(@_);
-}
-
-1;

Deleted: packages/libset-object-perl/branches/upstream/current/t/Saint.pm
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/Saint.pm	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/Saint.pm	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,17 +0,0 @@
-package Saint;
-
-#  `empty subclass' test
-
-use vars qw(@ISA);
-
-@ISA = qw(Person);
-
-sub stringify {
-
-   my $self = shift;
-
-   return "Saint $self->{firstname} $self->{name}";
-
-}
-
-1;

Deleted: packages/libset-object-perl/branches/upstream/current/t/abuse.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/abuse.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/abuse.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,63 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Test::More tests => 21;
-use Set::Object;
-
-my @objects = ( bless([], "Bob"),
-		bless([], "Jane"),
-		bless([], "Bernie"));
-
-my $set = Set::Object->new(@objects);
-
-# This test is because I once found as_string getting called
-# completely out of context, so I added an explicit check
-eval { Set::Object::as_string("yo momma") };
-like($@, qr/Tried to use as_string/, "as_string");
-
-is(($set == "doorpost"), undef, "== operator");
-is($set->equal(["pocketknife"]), undef, "equal method");
-
-is(($set != "doorpost"),     1, "!= operator");
-is($set->not_equal(["pocketknife"]), 1, "not_equal method");
-
-ok(( $set->union([ "carborettor" ]) == $set), "union method");
-
-eval{ my $x = $set + "carborettor" };
-like($@, qr/Tried to form union.*carborettor/, "+ operator");
-
-eval { my $x = $set * [ "octarine" ] };
-like($@, qr/Tried to .*intersection.*ARRAY/, "* operator");
-eval { my $x = $set->intersection([ "octarine" ]) };
-like($@, qr/Tried to .*intersection.*ARRAY/, "intersection method");
-
-eval { my $x = $set - { "deep" => "purple" } };
-like($@, qr/Tried to .*difference.*HASH/, "- operator");
-eval { my $x = $set->difference({ "uriah" => "heep" }) };
-like($@, qr/Tried to .*difference.*HASH/, "difference");
-
-eval { my $x = $set % $objects[0] };
-like($@, qr/Tried to .*symmetric.*Bob/, "% operator");
-eval { my $x = $set->symmetric_difference($objects[1]) };
-like($@, qr/Tried to .*symmetric.*Jane/, "symmetric_difference");
-
-eval { my $x = $set < $objects[0] };
-like($@, qr/Tried to .*proper subset.*Bob/, "< operator");
-eval { my $x = $set->proper_subset($objects[1]) };
-like($@, qr/Tried to .*proper subset.*Jane/, "proper_subset");
-
-eval { my $x = $set <= $objects[0] };
-like($@, qr/Tried to find subset.*Bob/, "<= operator");
-eval { my $x = $set->subset($objects[1]) };
-like($@, qr/Tried to find subset.*Jane/, "subset");
-
-eval { my $x = $set > $objects[0] };
-like($@, qr/Tried to .*proper superset.*Bob/, "> operator");
-eval { my $x = $set->proper_superset($objects[1]) };
-like($@, qr/Tried to .*proper superset.*Jane/, "proper_superset");
-
-eval { my $x = $set >= $objects[0] };
-like($@, qr/Tried to find superset.*Bob/, ">= operator");
-eval { my $x = $set->superset($objects[1]) };
-like($@, qr/Tried to find superset.*Jane/, "superset");
-

Deleted: packages/libset-object-perl/branches/upstream/current/t/clear.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/clear.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/clear.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,18 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$simpsons = Set::Object->new(@simpsons);
-
-print "1..2\n";
-
-$simpsons->clear();
-print 'not' unless $simpsons->size() == 0;
-print "ok 1\n";
-
-$simpsons->insert(@simpsons);
-print 'not' unless $simpsons->size() == @simpsons;
-print "ok 2\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/difference.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/difference.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/difference.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,29 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$simpsons = Set::Object->new($homer, $marge);
-$bouviers = Set::Object->new($marge, $patty, $selma);
-$simpsons_only = Set::Object->new($homer);
-$bouviers_only = Set::Object->new($patty, $selma);
-$empty = Set::Object->new;
-
-print "1..5\n";
-
-print 'not ' unless $simpsons->difference($bouviers) == $simpsons_only;
-print "ok 1\n";
-
-print 'not ' unless $simpsons - $bouviers == $simpsons_only;
-print "ok 2\n";
-
-print 'not ' unless $simpsons - $simpsons == $empty;
-print "ok 3\n";
-
-print 'not ' unless $simpsons_only  - $bouviers_only == $simpsons_only;
-print "ok 4\n";
-
-print 'not ' unless $simpsons - $empty == $simpsons;
-print "ok 5\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/equal.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/equal.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/equal.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,24 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-my $simpsons1 = Set::Object->new($homer, $marge);
-my $simpsons2 = Set::Object->new($homer, $marge);
-my $bouviers = Set::Object->new($marge, $patty, $selma, $patty, $selma);
-
-print "1..4\n";
-
-print 'not ' unless $simpsons1 == $simpsons1;
-print "ok 1\n";
-
-print 'not ' if $simpsons1 != $simpsons1;
-print "ok 2\n";
-
-print 'not ' unless $simpsons1 != $bouviers;
-print "ok 3\n";
-
-print 'not ' if $simpsons1 == $bouviers;
-print "ok 4\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/flags.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/flags.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/flags.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,39 +0,0 @@
-#!/usr/bin/perl -w
-#
-#  check that objects retain things like overloading after going in
-#  and out of Set::Object containers
-#
-
-use strict;
-
-use Set::Object;
-
-require 't/Person.pm';
-require 't/Saint.pm';
-
-print "1..2\n";
-
-my $person = new Person( firstname => "Montgomery", name => "Burns" );
-
-my $set = Set::Object->new($person);
-
-my ($newperson) = $set->members();
-
-if ($newperson ne "Montgomery Burns") {
-    print "not ";
-}
-print "ok 1\n";
-
-my $saint = Saint->new( firstname => "Timothy", name => "Leary" );
-
-$set = Set::Object->new($saint);
-
-my ($newsaint) = $set->members();
-
-if ($newsaint ne "Saint Timothy Leary") {
-    print "not ";
-}
-
-print "ok 2\n";
-
-

Deleted: packages/libset-object-perl/branches/upstream/current/t/includes.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/includes.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/includes.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,31 +0,0 @@
-#  -*- perl -*-
-
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-use Test::More tests => 7;
-
-Set::Object->new->includes( $homer );
-
-populate();
-
-$simpsons = Set::Object->new( $homer, $marge, $bart, $lisa, $maggie );
-
-ok( $simpsons->includes(), "Set::Object->includes()" );
-
-ok( $simpsons->includes($bart), "Set::Object->includes(single)" );
-
-ok( $simpsons->includes($homer, $marge, $bart, $lisa, $maggie),
-    "Set::Object->includes(many)" );
-
-ok( !$simpsons->includes($burns), "!Set::Object->includes(non-member)");
-
-ok( !$simpsons->includes($homer, $burns, $marge),
-    "!Set::Object->includes(members, non-member)");
-
-ok( !$simpsons->includes(Set::Object->new()),
-    "!Set::Object->includes(Set::Object->new())");
-
-ok( !$simpsons->includes("bogon"),
-    "!Set::Object->includes('bogon')");

Deleted: packages/libset-object-perl/branches/upstream/current/t/insert.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/insert.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/insert.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,62 +0,0 @@
-# -*- perl -*-
-
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-use Test::More tests => 18;
-
-populate();
-
-$simpsons = Set::Object->new;
-
-is($simpsons->size(), 0, "Set::Object->size() [ no contents ]");
-
-$added = $simpsons->insert($homer);
-is($added, 1, "Set::Object->insert() [ returned # added ]");
-is($simpsons->size(), 1, "Set::Object->size() [ one member ]");
-
-$added = $simpsons->insert($homer);
-is($added, 0, "Set::Object->insert() [ returned # added ]");
-is($simpsons->size(), 1, "Set::Object->size() [ one member ]");
-
-$added = $simpsons->insert($marge);
-is($added, 1, "Set::Object->insert() [ returned # added ]");
-is($simpsons->size(), 2, "Set::Object->size() [ two members ]");
-
-$simpsons->insert($maggie, $homer, $bart, $marge, $bart, $lisa, $lisa, $maggie);
-is($simpsons->size(), 5, "Set::Object->size() [ lots of inserts ]");
-
-# Now be really abusive
-eval { $simpsons->insert("bogon") };
-like($@, qr/Tried to insert/i, "Caught feeding in a bogon OK");
-
-my $test = new Set::Object;
-eval { $test->insert("bogon"); };
-is ( $test."", "Set::Object()", "as_string on bogon-ified set");
-
-# array refs
-my $array;
-$test->insert($array = [ "array", "ref" ]);
-my $array2 = [ "array", "ref" ];
-
-$test->insert($array);
-is ($test->size(), 1, "Inserted an array OK");
-ok ($test->includes($array), "Can put non-objects in a set");
-ok (!$test->includes($array2), "Lookup of identical item doesn't work");
-
-like ( $test."", qr/Set::Object\(ARRAY/, "Inserted an array OK");
-
-# hash refs
-$test->clear();
-my $hash;
-$test->insert($hash = { "hash" => "ref" });
-my $hash2 = { "hash" => "ref" };
-
-$test->insert($hash);
-is ($test->size(), 1, "Inserted an hash OK");
-ok ($test->includes($hash), "Can put non-objects in a set");
-ok (!$test->includes($hash2), "Lookup of identical item doesn't work");
-
-like ( $test."", qr/Set::Object\(HASH/, "Inserted an array OK");
-

Deleted: packages/libset-object-perl/branches/upstream/current/t/intersection.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/intersection.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/intersection.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,33 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$bart = $bart;
-$marge = $marge;
-
-$kids = Set::Object->new($bart, $lisa, $maggie);
-$females = Set::Object->new($marge, $lisa, $maggie);
-$babies = Set::Object->new($maggie);
-
-print "1..6\n";
-
-print 'not ' unless $kids->intersection($females) == Set::Object->new($lisa, $maggie);
-print "ok 1\n";
-
-print 'not ' unless $kids->intersection($females, $babies) == Set::Object->new($maggie);
-print "ok 2\n";
-
-print 'not ' unless $kids * $females == Set::Object->new($lisa, $maggie);
-print "ok 3\n";
-
-print 'not ' unless $kids * $females == $females * $kids;
-print "ok 4\n";
-
-print 'not ' unless $kids * $kids == $kids;
-print "ok 5\n";
-
-print 'not ' unless ($kids * Set::Object->new())->size == 0;
-print "ok 6\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/members.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/members.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/members.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,32 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$simpsons = Set::Object->new();
-
-print "1..3\n";
-
-print 'not ' if $simpsons->members();
-print "ok 1\n";
-
-@members1 = @simpsons;
-@members1 = sort { $a->{firstname} cmp $b->{firstname} } @members1;
-
-$simpsons->insert(@members1);
-@members2 = $simpsons->members();
-
-print 'not ' unless @members2 == 5;
-print "ok 2\n";
-
-@members2 = sort @members2;
-
-foreach $member1 (@members1)
-{
-   my $foo = shift(@members2);
-   unless ($member1 == $foo) { print 'not '; last }
-}
-
-print "ok 3\n";

Copied: packages/libset-object-perl/branches/upstream/current/t/object/Person.pm (from rev 882, packages/libset-object-perl/branches/upstream/current/t/Person.pm)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/Saint.pm (from rev 882, packages/libset-object-perl/branches/upstream/current/t/Saint.pm)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/abuse.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/abuse.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/clear.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/clear.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/difference.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/difference.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/equal.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/equal.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/flags.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/flags.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/includes.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/includes.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/insert.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/insert.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/intersection.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/intersection.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/members.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/members.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/properties.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/properties.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/refcount.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/refcount.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/remove.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/remove.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/storable.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/storable.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/subsuper.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/subsuper.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/symmetric_difference.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/symmetric_difference.t)

Copied: packages/libset-object-perl/branches/upstream/current/t/object/union.t (from rev 882, packages/libset-object-perl/branches/upstream/current/t/union.t)

Deleted: packages/libset-object-perl/branches/upstream/current/t/properties.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/properties.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/properties.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,329 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Test::More tests => 79;
-use Set::Object qw(ish_int is_int is_double is_string is_object
-		   blessed reftype refaddr is_key);
-
-is(is_int(0),         1, "is_int(0)");
-is(is_int(7),         1, "is_int(7)");
-is(is_key(7),         1, "is_key(7)");
-is(is_int(7.0),   undef, "!is_int(7.0)");
-is(is_key(7.0),       1, "is_key(7.0)");
-is(is_int('7'),   undef, "!is_int('7')");
-is(is_key('7'),       1, "is_key('7')");
-
-is(is_string(7),     undef, "!is_string()");
-is(is_string(7.0),   undef, "!is_string(7.0)");
-is(is_string("7"),       1, "is_string('7')");
-
-is(is_double(7),     undef, "!is_double(7)");
-is(is_double(7.0),       1, "is_double(7.0)");
-is(is_double("7"),   undef, "!is_double('7')");
-
-# behvaiour for numeric strings
-my $foo;
-is(is_int($foo="7"), undef, "!is_int(\$foo = '7')");
-is(is_double($foo),  undef, "!is_double($foo)");
-is(ish_int($foo),    undef, "!ish_int($foo)");
-
-# behaviour changes between Perls
-#is(is_int($foo+0),       1, "is_int(\$foo + 0)");
-is(is_int(int($foo)),    1, "is_int(int(\$foo))");
-# behaviour changes between Perls
-#is(is_double($foo),  undef, "is_double($foo)");
-is(ish_int($foo),        7, "ish_int($foo)");
-
-is(is_double($foo+0.01-0.01), 1, "is_double(\$foo + 0)");
-is(is_double($foo),      1, "is_double($foo)");
-is(is_int(int($foo)),    1, "is_int(int(\$foo))");
-is(ish_int($foo),        7, "ish_int($foo)");
-
-{
-# no warnings for brevity
-local($^W) = 0;
-
-is(ish_int($foo = "7am"), undef,
-   "!defined(ish_int($foo = '7am'))");
-is(ish_int($foo + 0),   7, "ish_int(\$foo + 0) == 7");
-# behaviour changes between Perls
-#is(is_int($foo),    undef, "!is_int($foo)");
-is(is_double($foo),     1, "is_double($foo)");
-#diag("foo is $foo");
-is(ish_int($foo),   undef, "!defined(ish_int($foo))");
-
-is(ish_int($foo = "7.0"), undef,
-   "!defined(ish_int($foo = '7.0'))");
-is(ish_int($foo + 0),   7, "ish_int($foo + 0) == 7");
-# behaviour changes between Perls
-# is(is_int($foo),    undef, "!is_int($foo)");
-is(is_double($foo),     1, "is_double($foo)");
-is(ish_int($foo),   undef, "!defined(ish_int($foo))");
-
-is(ish_int($foo = "7e6"), undef,
-   "!defined(ish_int($foo = '7e6'))");
-is(ish_int($foo + 0), 7e6, "ish_int($foo + 0) == 7e6");
-# behaviour changes between Perls
-# is(is_int($foo),    undef, "!is_int($foo)");
-is(is_double($foo),     1, "is_double($foo)");
-is(ish_int($foo),   undef, "!defined(ish_int($foo))");
-
-is(ish_int($foo = "7"), undef,
-   "!defined(ish_int($foo = '7'))");
-is(ish_int($foo + 0.001 - 0.001),   7, "ish_int($foo + 0) == 7");
-is(is_double($foo),     1, "is_double($foo)");
-# behaviour changes between Perls
-# is(is_int($foo),    undef, "is_int($foo)");
-is(ish_int($foo),       7, "ish_int($foo) == 7");
-
-is(ish_int($foo = "0"), undef,
-   "!defined(ish_int($foo = '0'))");
-is(ish_int($foo + 0.001 - 0.001),   0, "ish_int($foo + 0) == 0");
-is(is_double($foo),     1, "is_double($foo)");
-# behaviour changes between Perls
-# is(is_int($foo),    undef, "is_int($foo)");
-is(ish_int($foo),       0, "ish_int($foo) == 7");
-
-# value must be within 1e-9 of an int
-is(ish_int(7.000000001234), undef,
-   "!ish_int(7.000000001234)");
-is(ish_int(7.0000000001234), 7,
-   "ish_int(7.0000000001234) == 7");
-
-}
-
-is(blessed($foo = []), undef, "!blessed(\$foo = [])");
-is(is_key($foo), undef, "is_key([])");
-is(reftype($foo), "ARRAY",
-   "reftype(\$foo) eq 'ARRAY'");
-
-bless $foo, "This";
-is(blessed($foo), "This", "blessed(\$foo) eq 'This'");
-is(reftype($foo), "ARRAY", "reftype(\$foo) eq 'ARRAY'");
-is(is_key($foo), undef, "is_key(blessed array)");
-
-$foo = {};
-bless $foo, "This";
-is(reftype({}),    "HASH", "reftype({})");
-is(reftype($foo),  "HASH", "reftype(\$foo)");
-is(is_key($foo), undef, "is_key(blessed hash)");
-
-my %foo;
-my $tiehandle = tie %foo, "This";
-
-is(reftype(\%foo), "HASH", "reftype(\%foo) - tied");
-is(reftype($tiehandle),
-   "ARRAY", "reftype(\$tiehandle)");
-untie(%foo);
-
-my $psuedonum = psuedonum->new(7);
-
-ok($psuedonum == 7, "Pseudonum numifies OK");
-ok($psuedonum == 7.0, "Pseudonum numifies OK");
-ok($psuedonum eq "7", "Pseudonum stringifies OK");
-is(blessed($psuedonum), "psuedonum", "Pseudonum is blessed");
-is(ish_int($psuedonum), 7, "ish_int(Pseudonum)");
-is(is_key($psuedonum), 1, "is_key(psuedonum)");
-$psuedonum = [ ];
-is(is_key($psuedonum), undef, "is_key(psuedonum/hash)");
-
-my $nevernum = nevernum->new(7);
-
-eval { if ($nevernum == 7) { } };
-ok($@, "nevernum dies when numified");
-eval { if ($nevernum == 7.0) { } };
-ok($@, "nevernum dies when doublified");
-ok($nevernum eq "7", "nevernum stringifies OK");
-ok(blessed($nevernum) eq "nevernum", "nevernum is blessed");
-is(ish_int($nevernum), undef, "ish_int(Nevernum)");
-is(is_key($nevernum), 1, "is_key(nevernum)");
-
-my $notreallynum = notreallynum->new(7);
-
-ok($notreallynum == 7, "notreallynum numifies OK");
-ok($notreallynum == 7.0, "notreallynum numifies OK");
-ok($notreallynum eq "7", "notreallynum stringifies OK");
-ok(blessed($notreallynum) eq "notreallynum", "nevernum is blessed");
-is(ish_int($notreallynum), undef, "ish_int(notreallynum)");
-is(is_key($nevernum), 1, "is_key(notreallynum)");
-
-# now test tied scalars
-$tiehandle = tie $foo, "This";
-$foo = 7;
-
-ok(tied $foo, "\$foo is tied");
-
-# my @spells = detect_magic($foo);
-# ok(@spells && $spells[0] =~ m/Magic type q/,
-# "Foo is definitely tied");
-
-#use Devel::Peek qw(Dump);
-#print Dump $foo;
-
-is(ish_int($foo), 7, "ish_int(tied var)");
-eval { _ish_int($foo) };
-like($@, qr/tie/, "ish_int(tied var)");
-is(is_key($foo), 1, "is_key(tied var)");
-
-ok(refaddr($notreallynum) > 0 && refaddr($notreallynum) != refaddr($nevernum),
-   "refaddr()");
-
-exit(0);
-
-# unused debugging function
-sub showit {
-    my $var = shift;
-    if (defined $var) {
-	if (is_int($var)) {
-	    return $var;
-	} elsif (is_double($var)) {
-	    return sprintf("%e",$var);
-	} elsif (is_string($var)) {
-	    return "`$var'";
-	} elsif (my $b = blessed($var)) {
-	    return "Object($b)(".reftype($var).")";
-	} else {
-	    return "onion";
-	}
-    } else {
-	return "undef";
-    }
-}
-package This;
-
-# this class is an array pretending to be a hash
-
-sub TIESCALAR {
-    my $invocant = shift;
-    my $test = [ ];
-    return bless $test, $invocant;
-}
-
-sub TIEHASH {
-    my $invocant = shift;
-    my $test = [ { } ];
-    return bless $test, $invocant;
-}
-
-sub FETCH {
-    my $self = shift;
-
-    if (@_) {
-	my $key = shift;
-	if (my $idx = ish_int($key)) {
-	    return $self->[$idx+1];
-	} else {
-	    if (exists $self->[0]->{$key}) {
-		return $self->[$self->[0]->{$key}];
-	    } else {
-		return undef;
-	    }
-	}
-    } else {
-	# scalar fetch
-	return $self->[0];
-    }
-}
-
-sub STORE {
-    my $self = shift;
-    if (@_ == 2) {
-	# hash set
-	my $key  = shift;
-
-	if (!defined $key) {
-	    $key = "";
-	}
-    } elsif (@_ == 1) {
-	# scalar set
-	$self->[0] = shift;
-    }
-}
-
-sub UNTIE {
-    my $self = shift;
-    @$self=();
-}
-
-package psuedonum;
-
-use overload
-    '""' => \&stringify,
-    '0+' => \&numify,
-    fallback => 1;
-
-sub new {
-    my $self = shift;
-    my $val = shift;
-    return bless { val => $val }
-}
-
-sub set {
-    my $self = shift;
-    my $val = shift;
-    $self->{val} = $val;
-}
-
-sub stringify {
-    my $self = shift;
-    return "$self->{val}";
-}
-
-sub numify {
-    my $self = shift;
-    return $self->{val} + 0;
-}
-
-package notreallynum;
-
-use overload
-    '""' => \&stringify,
-    fallback => 1;
-
-sub new {
-    my $self = shift;
-    my $val = shift;
-    return bless { val => $val }
-}
-
-sub set {
-    my $self = shift;
-    my $val = shift;
-    $self->{val} = $val;
-}
-
-sub stringify {
-    my $self = shift;
-    return "$self->{val}";
-}
-
-package nevernum;
-
-use overload
-    '""' => \&stringify,
-    'eq' => \&equal,
-    fallback => 0;
-
-sub new {
-    my $self = shift;
-    my $val = shift;
-    return bless { val => $val }
-}
-
-sub set {
-    my $self = shift;
-    my $val = shift;
-    $self->{val} = $val;
-}
-
-sub stringify {
-    my $self = shift;
-    return "$self->{val}";
-}
-
-sub equal {
-    my $self = shift;
-    my $other = shift;
-    return $self->{val} eq $other;
-}
-

Deleted: packages/libset-object-perl/branches/upstream/current/t/refcount.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/refcount.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/refcount.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,49 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-print "1..9\n";
-
-$simpsons = Set::Object->new(
-   new Person( firstname => 'Bart', name => 'Simpson' ),
-   new Person( firstname => 'Lisa', name => 'Simpson' ),
-   new Person( firstname => 'Maggie', name => 'Simpson' ) );
-
-print 'not' unless $Person::n == 3;
-print "ok 1\n";
-
-$simpsons->insert();
-print 'not ' unless $Person::n == 3;
-print "ok 2\n";
-
-$simpsons->insert($homer = new Person( firstname => 'Homer', name => 'Simpson' ));
-print 'not ' unless $Person::n == 4;
-print "ok 3\n";
-
-$simpsons->remove($homer);
-print 'not ' unless $Person::n == 4;
-print "ok 4\n";
-
-undef $homer;
-print 'not ' unless $Person::n == 3;
-print "ok 5\n";
-
-$simpsons = undef;
-print 'not ' if $Person::n;
-print "ok 6\n";
-
-my $n = 31;
-my $big = Set::Object->new( map { Person->new } 1..$n );
-print 'not ' if $Person::n != $n;
-print "ok 7\n";
-
-{
-	my $same = $big - Set::Object->new();
-	print 'not ' if $same->size != $n;
-	print "ok 8\n";
-}
-
-$big->clear();
-print 'not ' if $Person::n;
-print "ok 9\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/remove.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/remove.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/remove.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,29 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$patty = $patty;
-$selma = $selma;
-$burns = $burns;
-
-Set::Object->new->remove($patty);
-
-$simpsons = Set::Object->new($homer, $marge, $bart, $lisa, $maggie);
-
-print "1..3\n";
-
-$removed = $simpsons->remove($homer);
-print 'not ' unless $simpsons->size() == 4 && $removed == 1
-   && $simpsons == Set::Object->new($marge, $bart, $lisa, $maggie);
-print "ok 1\n";
-
-$removed = $simpsons->remove($burns);
-print 'not ' unless $simpsons->size() == 4 && $removed == 0;
-print "ok 2\n";
-
-$removed = $simpsons->remove($patty, $marge, $selma);
-print 'not ' unless $simpsons->size() == 3 && $removed == 1;
-print "ok 3\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/storable.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/storable.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/storable.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,48 +0,0 @@
-#  -*- perl -*-
-#
-#  Storable test for Set::Object objects
-
-use strict;
-
-BEGIN {
-    eval "use Storable qw(freeze thaw dclone)";
-    if ($@) {
-	eval 'use Test::More skip_all => "Storable not installed"';
-	exit(0);
-    } else {
-	eval 'use Test::More tests => 7';
-    }
-}
-
-use_ok("Set::Object", qw(refaddr));
-my $objects = [ map { bless { $_ => rand(42) }, $_ }
-		qw(Barnie Fred Wilma)                 ];
-
-my $stored = freeze ($objects);
-is_deeply(thaw($stored), $objects, "Storable works");
-
-my $set = Set::Object->new(@$objects);
-$stored = freeze($set);
-
-use Data::Dumper;
-#print Dumper $stored;
-
-my $returned = thaw($stored);
-#print "no segfault yet!\n";
-#diag(Dumper($returned, $set));
-is_deeply([ sort { ref($a) cmp ref($b) } $returned->members ],
-	  [ sort { ref($a) cmp ref($b) } $set->members ],
-	  "Set::Object serialises via Storable!");
-isnt($$returned, $$set, "thaw returned a new Set::Object");
-
-my $spawned = dclone($set);
-is_deeply([ sort { ref($a) cmp ref($b) } $spawned->members ],
-	  [ sort { ref($a) cmp ref($b) } $set->members ],
-	  "Set::Object dclones via Storable!");
-isnt($$spawned, $$set, "dclone returned a new Set::Object");
-
-my $old;
-my $test = dclone ($old = [ map { Set::Object->new() } (1..1000) ]);
-
-is(@$old, @$test, "empty sets");
-

Deleted: packages/libset-object-perl/branches/upstream/current/t/subsuper.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/subsuper.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/subsuper.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,56 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-use vars qw( $homer $marge $bart $lisa $maggie );
-
-$simpsons = Set::Object->new( $homer, $marge, $bart, $lisa, $maggie );
-$parents = Set::Object->new( $homer, $marge );
-$empty = Set::Object->new();
-
-print "1..14\n";
-
-print 'not ' unless $parents < $simpsons;
-print "ok 1\n";
-
-print 'not ' if $simpsons < $parents;
-print "ok 2\n";
-
-print 'not ' if $parents < $parents;
-print "ok 3\n";
-
-print 'not ' unless $parents <= $simpsons;
-print "ok 4\n";
-
-print 'not ' unless $parents <= $parents;
-print "ok 5\n";
-
-print 'not ' unless $empty < $simpsons;
-print "ok 6\n";
-
-print 'not ' unless $empty <= $simpsons;
-print "ok 7\n";
-
-print 'not ' unless $simpsons > $parents;
-print "ok 8\n";
-
-print 'not ' if $parents > $simpsons;
-print "ok 9\n";
-
-print 'not ' if $simpsons > $simpsons;
-print "ok 10\n";
-
-print 'not ' unless $simpsons >= $parents;
-print "ok 11\n";
-
-print 'not ' unless $simpsons >= $simpsons;
-print "ok 12\n";
-
-print 'not ' unless $parents > $empty;
-print "ok 13\n";
-
-print 'not ' unless $parents >= $empty;
-print "ok 14\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/symmetric_difference.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/symmetric_difference.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/symmetric_difference.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,29 +0,0 @@
-use Set::Object;
-
-require 't/Person.pm';
-package Person;
-
-populate();
-
-$homer = $homer;
-$patty = $patty;
-$selma = $selma;
-
-$simpsons = Set::Object->new($homer, $marge);
-$bouviers = Set::Object->new($marge, $patty, $selma);
-$trouble = Set::Object->new($homer, $patty, $selma);
-$empty = Set::Object->new;
-
-print "1..4\n";
-
-print 'not ' unless $simpsons->symmetric_difference($bouviers) == $trouble;
-print "ok 1\n";
-
-print 'not ' unless $simpsons % $bouviers == $trouble;
-print "ok 2\n";
-
-print 'not ' unless $simpsons % $simpsons == $empty;
-print "ok 3\n";
-
-print 'not ' unless $simpsons % $empty == $simpsons;
-print "ok 4\n";

Deleted: packages/libset-object-perl/branches/upstream/current/t/union.t
===================================================================
--- packages/libset-object-perl/branches/upstream/current/t/union.t	2005-04-05 22:36:27 UTC (rev 882)
+++ packages/libset-object-perl/branches/upstream/current/t/union.t	2005-04-05 22:40:02 UTC (rev 883)
@@ -1,28 +0,0 @@
-use Set::Object;
-
-require 't/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;
-
-print "1..5\n";
-
-print 'not ' unless $simpsons->union($bouviers) == $both;
-print "ok 1\n";
-
-print 'not ' unless $simpsons + $bouviers == $both;
-print "ok 2\n";
-
-print 'not ' unless $bouviers + $simpsons == $both;
-print "ok 3\n";
-
-print 'not ' unless $simpsons + $simpsons == $simpsons;
-print "ok 4\n";
-
-print 'not ' unless $simpsons + $empty == $simpsons;
-print "ok 5\n";