From 42d28bc62dee824cd527d798f441902b14bb3728 Mon Sep 17 00:00:00 2001 From: mertz Date: Tue, 23 Sep 2003 12:15:15 +0000 Subject: initial release of some real (very very tiny) tests, as they are working now without Tk::Zinc being installed --- Perl/t/Import.t | 30 +++++++++++++++++++++++ Perl/t/PreviousKnownBugs.t | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 Perl/t/Import.t create mode 100644 Perl/t/PreviousKnownBugs.t diff --git a/Perl/t/Import.t b/Perl/t/Import.t new file mode 100644 index 0000000..862904c --- /dev/null +++ b/Perl/t/Import.t @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w + +# +# $Id: Import.t,v 1.1 2003-09-23 12:15:15 mertz Exp $ +# Author: Christophe Mertz +# + +# testing all the import + +BEGIN { + if (!eval q{ + use Test::More qw(no_plan); + 1; + }) { + print "# tests only work properly with installed Test::More module\n"; + print "1..1\n"; + print "ok 1\n"; + exit; + } +} + +require_ok( 'Tk::Zinc' ); +require_ok( 'Tk::Zinc::Debug' ); +require_ok( 'Tk::Zinc::Trace' ); +# require_ok( 'Tk::Zinc::TraceErrors' ); # incompatible with the previous one +# we do not test the previous, as it should be equivalent! +require_ok( 'Tk::Zinc::Graphics' ); +require_ok( 'Tk::Zinc::Logo' ); +require_ok( 'Tk::Zinc::Text' ); +diag("############## all imports"); diff --git a/Perl/t/PreviousKnownBugs.t b/Perl/t/PreviousKnownBugs.t new file mode 100644 index 0000000..1e8cdd7 --- /dev/null +++ b/Perl/t/PreviousKnownBugs.t @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +# +# $Id: PreviousKnownBugs.t,v 1.1 2003-09-23 12:15:15 mertz Exp $ +# Author: Christophe Mertz +# + +# testing all the import + +BEGIN { + if (!eval q{ + use Test::More qw(no_plan); + 1; + }) { + print "# tests only work properly with installed Test::More module\n"; + print "1..1\n"; + print "ok 1\n"; + exit; + } + if (!eval q{ + use Tk::Zinc; +# print "2222\n"; +# MainWindow->new(); +# print "3333\n"; + 1; + }) { + print "# tests only work properly when it is possible to create a mainwindow in your env\n"; + print "1..1\n"; + print "ok 1\n"; + exit; + } +} + +#use Tk::Zinc; + +$mw = MainWindow->new(); +$zinc = $mw->Zinc(-width => 100, -height => 100); + +like ($zinc, qr/^Tk::Zinc=HASH/ , "zinc has been created"); + +# following bug detected by A. Lemort +my $curve = $zinc->add('curve', 1, [[0, 0], [0, 100, 'c'], [100,100, 'c'], [100, 0]]) ; +$zinc->coords($curve, [[500,0], [500, 100], [600, 100], [600, 0]]); + +my @coords = $zinc->coords($curve,0); + + +TODO: + { + local $TODO = "after coords, zinc leave some 'c' in the coords in v3.294"; + + is_deeply([ @coords ], + [ [500,0], [500, 100], [600, 100], [600, 0] ], + "lemort bug 17 sept 2003 v3.2.94; testing correct value"); +} + +is_deeply([ @coords ], + [ [500,0], [500, 100, 'c'], [600, 100, 'c'], [600, 0] ], + "lemort bug 17 sept 2003 v3.2.94; testing false return"); + +diag("############## all known bugs"); -- cgit v1.1