5 use vars qw(@ISA @EXPORT_OK);
7 @EXPORT_OK = qw(diff_text_with_nul);
9 sub diff_text_with_nul {
10 my ($desc, $text1, $text2, @params) = @_;
12 my $builder = Test::Builder->new;
15 my $imbase = Imager->new(xsize => 100, ysize => 100);
16 my $imcopy = Imager->new(xsize => 100, ysize => 100);
18 $builder->ok($imbase->string(x => 5, 'y' => 50, size => 20,
20 @params), "$desc - draw text1");
21 $builder->ok($imcopy->string(x => 5, 'y' => 50, size => 20,
23 @params), "$desc - draw text2");
24 $builder->isnt_num(Imager::i_img_diff($imbase->{IMG}, $imcopy->{IMG}), 0,
25 "$desc - check result different");
34 Imager::Test - common functions used in testing Imager
38 use Imager::Test 'diff_text_with_nul';
39 diff_text_with_nul($test_name, $text1, $text2, @string_options);
43 This is a repository of functions used in testing Imager.
45 Some functions will only be useful in testing Imager itself, while
46 others should be useful in testing modules that use Imager.
48 No functions are exported by default.
54 =item diff_text_with_nul($test_name, $text1, $text2, @optios)
56 Creates 2 test images and writes $text1 to the first image and $text2
57 to the second image with the string() method. Each call adds 3 ok/not
58 ok to the output of the test script.
60 Extra options that should be supplied include the font and either a
61 color or channel parameter.
63 This was explicitly created for regression tests on #21770.
69 Tony Cook <tony@develop-help.com>