[perl-glib: 3/3] Add tests for Glib->info and Glib->debug
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-glib: 3/3] Add tests for Glib->info and Glib->debug
- Date: Sun, 24 May 2020 14:00:14 +0000 (UTC)
commit b3d6b99fbb5e4ce2a5998cb51b308c08a4019f56
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun May 24 15:59:12 2020 +0200
Add tests for Glib->info and Glib->debug
t/a.t | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/t/a.t b/t/a.t
index 90efc3b..6095714 100644
--- a/t/a.t
+++ b/t/a.t
@@ -18,7 +18,7 @@ if ($Config{archname} =~ m/^(x86_64|mipsel|mips|alpha)/
# and in 2.4.0 (actually 2.3.2).
plan skip_all => "g_log doubles messages by accident on 64-bit platforms";
} else {
- plan tests => 30;
+ plan tests => 32;
}
package Foo;
@@ -35,6 +35,20 @@ Glib->message (undef, 'whee message');
Glib->critical (undef, 'whee critical');
Glib->warning (undef, 'whee warning');
+{
+ local %ENV = %ENV;
+
+ # These should not call the __WARN__ handler above.
+ $ENV{G_MESSAGES_DEBUG} = '';
+ Glib->info (undef, 'whee info');
+ Glib->debug (undef, 'whee debug');
+
+ # Now they sould.
+ $ENV{G_MESSAGES_DEBUG} = 'all';
+ Glib->info (undef, 'whee info');
+ Glib->debug (undef, 'whee debug');
+}
+
my $id =
Glib::Log->set_handler (__PACKAGE__,
[qw/ error critical warning message info debug /],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]