4 use Test::More tests => 6;
6 my $log_name = "testout/t95log.log";
8 my $log_message = "test message 12345";
11 skip("Logging not build", 3)
12 unless Imager::i_log_enabled();
13 ok(Imager->open_log(log => $log_name), "open log")
14 or diag("Open log: " . Imager->errstr);
15 ok(-f $log_name, "file is there");
16 Imager->log($log_message);
20 if (open LOG, "< $log_name") {
21 $data = do { local $/; <LOG> };
24 like($data, qr/\Q$log_message/, "check message made it to the log");
28 skip("Logging built", 3)
29 if Imager::i_log_enabled();
31 ok(!Imager->open_log(log => $log_name), "should be no logfile");
32 is(Imager->errstr, "Logging disabled", "check error message");
33 ok(!-f $log_name, "file shouldn't be there");