Skip Menu |
 

This queue is for tickets about the Glib CPAN distribution.

Report information
The Basics
Id: 48070
Status: resolved
Priority: 0/
Queue: Glib

People
Owner: Nobody in particular
Requestors: potyl [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.222
Fixed in: (no value)

Attachments
0001-Export-SOURCE_CONTINUE-and-SOURCE_REMOVE-with-const.patch
0002-Unit-tests-for-the-constants.patch



Subject: Export the constants SOURCE_CONTINUE and SOURCE_REMOVE
Download (untitled) / with headers
text/plain 157b
Glib has two new constants SOURCE_CONTINUE and SOURCE_REMOVE but they are not exportable. This patches address this issue and provide rudimentary unit tests.
Subject: 0002-Unit-tests-for-the-constants.patch
From ce828565b066ece2912b31c2bd6af5e02a81548b Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez <emmanuel.rodriguez@gmail.com> Date: Tue, 21 Jul 2009 21:52:51 +0200 Subject: [PATCH] Unit tests for the constants --- t/constants.t | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+), 0 deletions(-) create mode 100644 t/constants.t diff --git a/t/constants.t b/t/constants.t new file mode 100644 index 0000000..2c94901 --- /dev/null +++ b/t/constants.t @@ -0,0 +1,59 @@ +#!/usr/bin/perl +# +# test the constants exported by Glib. +# +use strict; +use warnings; + +use Glib qw(:constants); +use Test::More tests => 9; + +ok(TRUE, "TRUE"); +ok(!FALSE, "FALSE"); + +ok( + G_PRIORITY_HIGH < G_PRIORITY_DEFAULT, + "G_PRIORITY_HIGH < G_PRIORITY_DEFAULT" +); +ok( + G_PRIORITY_DEFAULT < G_PRIORITY_HIGH_IDLE, + "G_PRIORITY_DEFAULT < G_PRIORITY_HIGH_IDLE" +); +ok( + G_PRIORITY_HIGH_IDLE < G_PRIORITY_DEFAULT_IDLE, + "G_PRIORITY_HIGH_IDLE < G_PRIORITY_DEFAULT_IDLE" +); +ok( + G_PRIORITY_DEFAULT_IDLE < G_PRIORITY_LOW, + "G_PRIORITY_DEFAULT_IDLE < G_PRIORITY_LOW" +); + +my $rw = G_PARAM_READWRITE; +is_deeply( + [ sort @{ $rw } ], + ['readable', 'writable'], + "G_PARAM_READWRITE" +); + + +ok(SOURCE_CONTINUE, "SOURCE_CONTINUE"); +ok(!SOURCE_REMOVE, "SOURCE_REMOVE"); + +__END__ + +Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for the +full list) + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Library General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) any +later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU Library General Public License for more +details. + +You should have received a copy of the GNU Library General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 59 +Temple Place - Suite 330, Boston, MA 02111-1307 USA. -- 1.6.0.4
Subject: 0001-Export-SOURCE_CONTINUE-and-SOURCE_REMOVE-with-const.patch
From da6624bbe2bff68259f5961caa2c5eab9e2d8705 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez <emmanuel.rodriguez@gmail.com> Date: Tue, 21 Jul 2009 21:50:55 +0200 Subject: [PATCH] Export SOURCE_CONTINUE and SOURCE_REMOVE with :constants. This patch allows the constants SOURCE_CONTINUE and SOURCE_REMOVE to be exported when doing: use Glib ':constants'; It also allows the constants to be exported when doing: use Glib qw(TRUE FALSE SOURCE_CONTINUE SOURCE_REMOVE); --- Glib.pm | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Glib.pm b/Glib.pm index 6576e53..73b5477 100644 --- a/Glib.pm +++ b/Glib.pm @@ -53,6 +53,8 @@ our %EXPORT_TAGS = ( G_PRIORITY_DEFAULT_IDLE G_PRIORITY_LOW G_PARAM_READWRITE + SOURCE_CONTINUE + SOURCE_REMOVE /], functions => [qw/ filename_to_unicode -- 1.6.0.4
The patches are also available through git @ http://github.com/potyl/perl-Glib/commits/constants
Download (untitled) / with headers
text/plain 322b
On Tue Jul 21 15:59:47 2009, POTYL wrote: Show quoted text
> Glib has two new constants SOURCE_CONTINUE and SOURCE_REMOVE but they > are not exportable. This patches address this issue and provide > rudimentary unit tests.
I just committed your changes with very minor modifications. Thanks for the patches, and sorry for the huge delay.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.