aboutsummaryrefslogtreecommitdiff
path: root/Perl/t
diff options
context:
space:
mode:
authormertz2004-06-13 07:38:22 +0000
committermertz2004-06-13 07:38:22 +0000
commit5dfa7e05e7ef49e8790571e2ee3ca448ad26115c (patch)
tree94f61a46c6fa6ab260ccb90a98400dc9b032f7ef /Perl/t
parent981653017bd669a3a7d8c6c261338088f539ef27 (diff)
downloadtkzinc-5dfa7e05e7ef49e8790571e2ee3ca448ad26115c.zip
tkzinc-5dfa7e05e7ef49e8790571e2ee3ca448ad26115c.tar.gz
tkzinc-5dfa7e05e7ef49e8790571e2ee3ca448ad26115c.tar.bz2
tkzinc-5dfa7e05e7ef49e8790571e2ee3ca448ad26115c.tar.xz
adding 6 tests for the bug detectged by D. Etienne 11 Jun 04
Diffstat (limited to 'Perl/t')
-rw-r--r--Perl/t/find.t40
1 files changed, 38 insertions, 2 deletions
diff --git a/Perl/t/find.t b/Perl/t/find.t
index 396a5a8..053fbb5 100644
--- a/Perl/t/find.t
+++ b/Perl/t/find.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# $Id: find.t,v 1.2 2004-04-02 12:01:49 mertz Exp $
+# $Id: find.t,v 1.3 2004-06-13 07:38:22 mertz Exp $
# Author: Christophe Mertz
#
@@ -14,7 +14,7 @@
BEGIN {
if (!eval q{
# use Test::More qw(no_plan);
- use Test::More tests => 16;
+ use Test::More tests => 22;
1;
}) {
print "# tests only work properly with installed Test::More module\n";
@@ -134,6 +134,42 @@ my @list;
[ ($zinc->find('withtype', "rectangle")) ],
"find with type 'rectangle' starting from .g1*");
+
+## testing overlapping find with atomic group (for testig the bug
+## reported by D. Etienne the 11th June 04
+$zinc->itemconfigure($g2, -atomic => 1);
+@list = $zinc->find('overlapping', 20,20,110,110);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find overlapping when group becomes atomic, without specifying starting group");
+
+@list = $zinc->find('overlapping', 20,20,110,110,1);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find overlapping when group becomes atomic, starting from group 1");
+
+@list = $zinc->find('overlapping', 20,20,110,110,1,1);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find overlapping when group becomes atomic, recursively, starting from group 1");
+
+
+## testing enclosing find with atomic group
+@list = $zinc->find('enclosed', 0,0,200,200);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find enclosed when group becomes atomic, without specifying starting group");
+
+@list = $zinc->find('enclosed', 0,0,200,200, 1);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find enclosed when group becomes atomic, starting from group 1");
+
+@list = $zinc->find('enclosed', 0,2,200,200, 1,1);
+&ok (&eq_array (\@list ,
+ [ $g2 ]),
+ "find enclosed when group becomes atomic, recursively, starting from group 1");
+
# Tk::MainLoop;