You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Ruslan U. Zakirov" <cu...@wildgate.miee.ru> on 2004/03/16 17:05:38 UTC

[mp2] make test fails in t/apache/util.t

Apache-2 form CVS as mp2.
Some locale/UTF issues?
I think it's not critical issue and I could force make install.

Verbose make test output:
t/apache/util....1..4
# Running under perl version 5.008003 for linux
# Current time local: Tue Mar 16 18:33:54 2004
# Current time GMT:   Tue Mar 16 15:33:54 2004
# Using Test.pm version 1.24
# testing : Apache::Util::ht_time($pool)
# expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
# received: Вто, 16 Мар 2004 15:33:57 GMT
not ok 1
# testing : Apache::Util::ht_time($pool, $time)
# expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
# received: Вто, 16 Мар 2004 15:33:57 GMT
not ok 2
# testing : Apache::Util::ht_time($pool, $time, $fmt)
# expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
# received: Вто, 16 Мар 2004 15:33:57 GMT
not ok 3
# testing : Apache::Util::ht_time($pool, $time, $fmt, $gmt)
# expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
# received: Вто, 16 Мар 2004 18:33:57 MSK
not ok 4
FAILED tests 1-4
         Failed 4/4 tests, 0.00% okay
Failed Test     Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/apache/util.t                4    4 100.00%  1-4


*** mod_perl version 1.9914

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
   MP_APXS         => /usr/local/apache-2/bin/apxs
   MP_COMPAT_1X    => 1
   MP_DEBUG        => 1
   MP_GENERATE_XS  => 1
   MP_INST_APACHE2 => 1
   MP_LIBNAME      => mod_perl
   MP_TRACE        => 1
   MP_USE_DSO      => 1


*** /usr/local/apache-2/bin/httpd -V
Server version: Apache/2.0.49-dev
Server built:   Mar 16 2004 17:56:42
Server's Module Magic Number: 20020903:7
Architecture:   32-bit
Server compiled with....
  -D APACHE_MPM_DIR="server/mpm/prefork"
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D HTTPD_ROOT="/usr/local/apache-2"
  -D SUEXEC_BIN="/usr/local/apache-2/bin/suexec"
  -D DEFAULT_PIDLOG="logs/httpd.pid"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_LOCKFILE="logs/accept.lock"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
  -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
   Platform:
     osname=linux, osvers=2.4.20-8.9asp, archname=i386-linux-thread-multi
     uname='linux support.acronis.com 2.4.20-8.9asp #1 thu apr 24 
15:43:19 msd 2003 i686 i686 i386 gnulinux '
     config_args='-des -Doptimize=-O2 -g -march=i386 -mcpu=i686 
-Dversion=5.8.3 -Dmyhostname=localhost -Dperladmin=root@localhost 
-Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr 
-Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib 
-Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun 
-Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio 
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less 
-isr -Dinc_version_list=5.8.2 5.8.1 5.8.0'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
     optimize='-O2 -g -march=i386 -mcpu=i686',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
     ccversion='', gccversion='3.2.2 20030222 (ASPLinux 3.2.2-5asp)', 
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='gcc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.2'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE'
     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS 
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
   Built under linux
   Compiled at Mar 14 2004 18:13:09
   %ENV:
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /usr/lib/perl5/5.8.3/i386-linux-thread-multi
     /usr/lib/perl5/5.8.3
     /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
     /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi
     /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
     /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
     /usr/lib/perl5/site_perl/5.8.3
     /usr/lib/perl5/site_perl/5.8.2
     /usr/lib/perl5/site_perl/5.8.1
     /usr/lib/perl5/site_perl/5.8.0
     /usr/lib/perl5/site_perl
     /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.8.3
     /usr/lib/perl5/vendor_perl/5.8.2
     /usr/lib/perl5/vendor_perl/5.8.1
     /usr/lib/perl5/vendor_perl/5.8.0
     /usr/lib/perl5/vendor_perl
     .

*** Packages of interest status:

Apache::Request: -
CGI            : 3.01
LWP            : 5.75, 5.76, 5.76
mod_perl       : 1.28


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by "Ruslan U. Zakirov" <cu...@wildgate.miee.ru>.
Stas Bekman wrote:
> Ruslan U. Zakirov wrote:
> 
>>>> I found solution. I've placed 'use locale' in package scope instead 
>>>> of sub scope and test goes fine. Perl "bug/feature"?
>>>
>>>
>>>
>>>
>>> No, my mistake. Please try this one:
>>
>>
>>
>> Nop.
>> Only attached one.
> 
> 
> So may be it is a bug in perl then. If you can reproduce it outside of 
> mod_perl with a short perl script with scopes, please consider 
> submitting a perl bugreport.
Ugu. Reported.
> 
> I've committed the fix. Thanks for the report and testing, Ruslan.
Thanks.
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by Stas Bekman <st...@stason.org>.
Ruslan U. Zakirov wrote:

>>> I found solution. I've placed 'use locale' in package scope instead 
>>> of sub scope and test goes fine. Perl "bug/feature"?
>>
>>
>>
>> No, my mistake. Please try this one:
> 
> 
> Nop.
> Only attached one.

So may be it is a bug in perl then. If you can reproduce it outside of 
mod_perl with a short perl script with scopes, please consider submitting a 
perl bugreport.

I've committed the fix. Thanks for the report and testing, Ruslan.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by "Ruslan U. Zakirov" <cu...@wildgate.miee.ru>.
Stas Bekman wrote:
> Ruslan U. Zakirov wrote:
> [...]
> 
>>> What's the transparent way to accomplish that? 'use locale' should 
>>> have done that I believe. See the perllocale manpage.
>>
>>
>> This experiment say that 'locale' is working fine:
>> perl -Mlocale -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
>> µ_0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZаАбБвВгГдДѓЃґҐђЂеЕєЄёЁжЖзЗѕЅиИіІїЇйЙјЈкКлЛљЉмМнНњЊоОпПрРсСтТќЌћЋуУўЎфФхХцЦчЧџЏшШщЩъЪыЫьЬэЭюЮяЯ 
>>
>> perl -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
>> 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz
> 
> 
> Perfect.
> 
>> I found solution. I've placed 'use locale' in package scope instead of 
>> sub scope and test goes fine. Perl "bug/feature"?
> 
> 
> No, my mistake. Please try this one:

Nop.
Only attached one.
		Good luck. Ruslan.
> 
> Index: t/response/TestApache/util.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/response/TestApache/util.pm,v
> retrieving revision 1.1
> diff -u -r1.1 util.pm
> --- t/response/TestApache/util.pm       9 Feb 2004 19:25:01 -0000       1.1
> +++ t/response/TestApache/util.pm       16 Mar 2004 19:19:32 -0000
> @@ -56,6 +56,8 @@
>  sub time_cmp {
>      my($time, $fmtdate, $comment, $exact_match) = @_;
> 
> +    use locale; # for matching strftime-like date-time strings
> +
>      if ($parse_time_ok && $exact_match) {
>          my $ptime = APR::Date::parse_http($fmtdate);
>          t_debug "fmtdate: $fmtdate";
> 
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 


Re: [mp2] make test fails in t/apache/util.t

Posted by Stas Bekman <st...@stason.org>.
Ruslan U. Zakirov wrote:
[...]
>> What's the transparent way to accomplish that? 'use locale' should 
>> have done that I believe. See the perllocale manpage.
> 
> This experiment say that 'locale' is working fine:
> perl -Mlocale -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
> µ_0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZаАбБвВгГдДѓЃґҐђЂеЕєЄёЁжЖзЗѕЅиИіІїЇйЙјЈкКлЛљЉмМнНњЊоОпПрРсСтТќЌћЋуУўЎфФхХцЦчЧџЏшШщЩъЪыЫьЬэЭюЮяЯ 
> 
> perl -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
> 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz

Perfect.

> I found solution. I've placed 'use locale' in package scope instead of 
> sub scope and test goes fine. Perl "bug/feature"?

No, my mistake. Please try this one:

Index: t/response/TestApache/util.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestApache/util.pm,v
retrieving revision 1.1
diff -u -r1.1 util.pm
--- t/response/TestApache/util.pm       9 Feb 2004 19:25:01 -0000       1.1
+++ t/response/TestApache/util.pm       16 Mar 2004 19:19:32 -0000
@@ -56,6 +56,8 @@
  sub time_cmp {
      my($time, $fmtdate, $comment, $exact_match) = @_;

+    use locale; # for matching strftime-like date-time strings
+
      if ($parse_time_ok && $exact_match) {
          my $ptime = APR::Date::parse_http($fmtdate);
          t_debug "fmtdate: $fmtdate";


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by "Ruslan U. Zakirov" <cu...@wildgate.miee.ru>.
Stas Bekman wrote:
> Ruslan U. Zakirov wrote:
> 
>> Stas Bekman wrote:
>>
>>> Ruslan U. Zakirov wrote:
>>>
>>>> Apache-2 form CVS as mp2.
>>>> Some locale/UTF issues?
>>>> I think it's not critical issue and I could force make install.
>>>>
>>>> Verbose make test output:
>>>> t/apache/util....1..4
>>>> # Running under perl version 5.008003 for linux
>>>> # Current time local: Tue Mar 16 18:33:54 2004
>>>> # Current time GMT:   Tue Mar 16 15:33:54 2004
>>>> # Using Test.pm version 1.24
>>>> # testing : Apache::Util::ht_time($pool)
>>>> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
>>>> # received: Вто, 16 Мар 2004 15:33:57 GMT
>>>> not ok 1
>>>
>>>
>>>
>> [snip]
>>
>> Hello, Stas.
>>
>>>
>>> Ouch, I thought that \w will match any letter, but I guess it won't 
>>> w/o loading locale. Does the problem go away if you apply this patch?
>>
>>
>> Nop.
>> I've got absolutely same results. I have ru_RU.CP1251 locale. And 
>> output from Apache::Util::ht_time conform to this. I see right date in 
>> console.
> 
> 
> NAME
>        locale - Perl pragma to use and avoid POSIX locales for built-in 
> opera-
>        tions
> 
>        This pragma tells the compiler to enable (or disable) the use of 
> POSIX
>        locales for built-in operations (LC_CTYPE for regular 
> expressions, and
>        LC_COLLATE for string comparison).  Each "use locale" or "no locale"
>        affects statements to the end of the enclosing BLOCK.
> 
> So, does your LC_CTYPE matches LC_TIME? If it doesn't, that will explain 
> the problem.
Does.
[cubic@cubic cubic]$ echo $LC_CTYPE

[cubic@cubic cubic]$ echo $LC_TIME

[cubic@cubic cubic]$ echo $LANG
ru_RU.CP1251
[cubic@cubic cubic]$ locale
LANG=ru_RU.CP1251
LC_CTYPE="ru_RU.CP1251"
LC_NUMERIC="ru_RU.CP1251"
LC_TIME="ru_RU.CP1251"
LC_COLLATE="ru_RU.CP1251"
LC_MONETARY="ru_RU.CP1251"
LC_MESSAGES="ru_RU.CP1251"
LC_PAPER="ru_RU.CP1251"
LC_NAME="ru_RU.CP1251"
LC_ADDRESS="ru_RU.CP1251"
LC_TELEPHONE="ru_RU.CP1251"
LC_MEASUREMENT="ru_RU.CP1251"
LC_IDENTIFICATION="ru_RU.CP1251"
LC_ALL=

> 
>> I'v checked $fmtdate with Encode::is_utf8, it's not utf8 internal 
>> format in both cases. I never used a lot 'use locale' so don't know 
>> how exactly perl handle regexps in this case.
>>
>> I have success with next tricky code:
>> $fmtdate = Apache::Util::ht_time($r->pool);
>> $fmtdate = Encode::decode('cp1251', $fmtdate);
> 
> 
> What's the transparent way to accomplish that? 'use locale' should have 
> done that I believe. See the perllocale manpage.
This experiment say that 'locale' is working fine:
perl -Mlocale -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
µ_0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZаАбБвВгГдДѓЃґҐђЂеЕєЄёЁжЖзЗѕЅиИіІїЇйЙјЈкКлЛљЉмМнНњЊоОпПрРсСтТќЌћЋуУўЎфФхХцЦчЧџЏшШщЩъЪыЫьЬэЭюЮяЯ
perl -e 'print +(sort grep /\w/, map { chr } 0..255), "\n";'
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz


I found solution. I've placed 'use locale' in package scope instead of 
sub scope and test goes fine. Perl "bug/feature"?

		Best regards. Ruslan.
> 
> 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by Stas Bekman <st...@stason.org>.
Ruslan U. Zakirov wrote:
> Stas Bekman wrote:
> 
>> Ruslan U. Zakirov wrote:
>>
>>> Apache-2 form CVS as mp2.
>>> Some locale/UTF issues?
>>> I think it's not critical issue and I could force make install.
>>>
>>> Verbose make test output:
>>> t/apache/util....1..4
>>> # Running under perl version 5.008003 for linux
>>> # Current time local: Tue Mar 16 18:33:54 2004
>>> # Current time GMT:   Tue Mar 16 15:33:54 2004
>>> # Using Test.pm version 1.24
>>> # testing : Apache::Util::ht_time($pool)
>>> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
>>> # received: Вто, 16 Мар 2004 15:33:57 GMT
>>> not ok 1
>>
>>
> [snip]
> 
> Hello, Stas.
> 
>>
>> Ouch, I thought that \w will match any letter, but I guess it won't 
>> w/o loading locale. Does the problem go away if you apply this patch?
> 
> Nop.
> I've got absolutely same results. I have ru_RU.CP1251 locale. And output 
> from Apache::Util::ht_time conform to this. I see right date in console.

NAME
        locale - Perl pragma to use and avoid POSIX locales for built-in opera-
        tions

        This pragma tells the compiler to enable (or disable) the use of POSIX
        locales for built-in operations (LC_CTYPE for regular expressions, and
        LC_COLLATE for string comparison).  Each "use locale" or "no locale"
        affects statements to the end of the enclosing BLOCK.

So, does your LC_CTYPE matches LC_TIME? If it doesn't, that will explain the 
problem.

> I'v checked $fmtdate with Encode::is_utf8, it's not utf8 internal format 
> in both cases. I never used a lot 'use locale' so don't know how exactly 
> perl handle regexps in this case.
> 
> I have success with next tricky code:
> $fmtdate = Apache::Util::ht_time($r->pool);
> $fmtdate = Encode::decode('cp1251', $fmtdate);

What's the transparent way to accomplish that? 'use locale' should have done 
that I believe. See the perllocale manpage.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by "Ruslan U. Zakirov" <cu...@wildgate.miee.ru>.
Stas Bekman wrote:
> Ruslan U. Zakirov wrote:
> 
>> Apache-2 form CVS as mp2.
>> Some locale/UTF issues?
>> I think it's not critical issue and I could force make install.
>>
>> Verbose make test output:
>> t/apache/util....1..4
>> # Running under perl version 5.008003 for linux
>> # Current time local: Tue Mar 16 18:33:54 2004
>> # Current time GMT:   Tue Mar 16 15:33:54 2004
>> # Using Test.pm version 1.24
>> # testing : Apache::Util::ht_time($pool)
>> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
>> # received: Вто, 16 Мар 2004 15:33:57 GMT
>> not ok 1
> 
[snip]

Hello, Stas.
> 
> Ouch, I thought that \w will match any letter, but I guess it won't w/o 
> loading locale. Does the problem go away if you apply this patch?
Nop.
I've got absolutely same results. I have ru_RU.CP1251 locale. And output 
from Apache::Util::ht_time conform to this. I see right date in console.
I'v checked $fmtdate with Encode::is_utf8, it's not utf8 internal format 
in both cases. I never used a lot 'use locale' so don't know how exactly 
perl handle regexps in this case.

I have success with next tricky code:
$fmtdate = Apache::Util::ht_time($r->pool);
$fmtdate = Encode::decode('cp1251', $fmtdate);

		Best regards. Ruslan.

[snip]

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] make test fails in t/apache/util.t

Posted by Stas Bekman <st...@stason.org>.
Ruslan U. Zakirov wrote:
> Apache-2 form CVS as mp2.
> Some locale/UTF issues?
> I think it's not critical issue and I could force make install.
> 
> Verbose make test output:
> t/apache/util....1..4
> # Running under perl version 5.008003 for linux
> # Current time local: Tue Mar 16 18:33:54 2004
> # Current time GMT:   Tue Mar 16 15:33:54 2004
> # Using Test.pm version 1.24
> # testing : Apache::Util::ht_time($pool)
> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
> # received: Вто, 16 Мар 2004 15:33:57 GMT
> not ok 1
> # testing : Apache::Util::ht_time($pool, $time)
> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
> # received: Вто, 16 Мар 2004 15:33:57 GMT
> not ok 2
> # testing : Apache::Util::ht_time($pool, $time, $fmt)
> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
> # received: Вто, 16 Мар 2004 15:33:57 GMT
> not ok 3
> # testing : Apache::Util::ht_time($pool, $time, $fmt, $gmt)
> # expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
> # received: Вто, 16 Мар 2004 18:33:57 MSK
> not ok 4
> FAILED tests 1-4
>         Failed 4/4 tests, 0.00% okay
> Failed Test     Stat Wstat Total Fail  Failed  List of Failed
> ------------------------------------------------------------------------------- 

Ouch, I thought that \w will match any letter, but I guess it won't w/o 
loading locale. Does the problem go away if you apply this patch?

Index: t/response/TestApache/util.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestApache/util.pm,v
retrieving revision 1.1
diff -u -r1.1 util.pm
--- t/response/TestApache/util.pm       9 Feb 2004 19:25:01 -0000       1.1
+++ t/response/TestApache/util.pm       16 Mar 2004 17:38:01 -0000
@@ -27,6 +27,8 @@
      plan $r, tests => 4;

      {
+        use locale; # for matching strftime-like date-time strings
+
          my $time = time;
          my $fmt = "%a, %d %b %Y %H:%M:%S %Z";
          my $fmtdate;



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html