Hello, Dmitriy.
You write 23 мая 2008 г., 23:48:56:

DSS> Hello, J..
DSS> You write 23 мая 2008 г., 0:18:11:

JS>> On Thu, May 22, 2008 at 10:05 AM, Dmitriy S. Sinyavskiy <[EMAIL 
PROTECTED]> wrote:
>>>
>>> People? what about my patch? I heven't got received any response.
>>> I'll be glad to now some news.
>>> Thanks.
>>>

JS>> Your mailserver is rejecting mail.  I suggest fixing your mail server
JS>> or viewing the list archives to make sure that you're not missing
JS>> things.

JS>> Thread:
JS>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg02771.html


DSS> Test. Must be saved as UTF-8:
DSS> =================================
DSS> use strict;
DSS> use warnings;

DSS> use Test::More 'no_plan';
DSS> use URI;

DSS> use_ok('Catalyst');

DSS> my $request = Catalyst::Request->new( {
base =>> URI->new('http://127.0.0.1/foo')
DSS> } );

DSS> my $context = Catalyst->new( {
request =>> $request,
namespace =>> 'yada',
DSS> } );

DSS> # test encode first argument with utf-8,
DSS> {
$request->>base( URI->new('http://127.0.0.1/') );

$context->>namespace('');

DSS> is( Catalyst::uri_for( $context, '/animal/ёж', 'чёт', { param1 => "щуп" 
})->as_string,
DSS> 
'http://127.0.0.1/animal/%D1%91%D0%B6/%D1%87%D1%91%D1%82?param1=%C3%91%C2%89%C3%91%C2%83%C3%90%C2%BF',
DSS> 'URI for undef action with first param as string in unicode'
DSS> );
DSS> }

The previous test was wrong, sorry. I've found a mistake and correct
it. Test case including check for special chars <?>.

Tested today - it's working right with patch.

Test
=============

use strict;
use warnings;

use Test::More 'no_plan';
use URI;

use_ok('Catalyst');

my $request = Catalyst::Request->new( {
base => URI->new('http://127.0.0.1/foo')
} );

my $context = Catalyst->new( {
request => $request,
namespace => 'yada',
} );

# test encode first argument with utf-8,
{
$request->base( URI->new('http://127.0.0.1/') );

$context->namespace('');

is( Catalyst::uri_for( $context, '/animal/ёж', 'чёт', { param1 => "щуп" 
})->as_string,
'http://127.0.0.1/animal/%D1%91%D0%B6/%D1%87%D1%91%D1%82?param1=%D1%89%D1%83%D0%BF',
'URI for with first param as string in unicode'
);

is( Catalyst::uri_for( $context, '/??', '?', { param1 => "?" })->as_string,
'http://127.0.0.1/%3F%3F/%3F?param1=%3F',
'URI for with special char <?> in args and param'
);

}




-- 
 dreel                    mailto:[EMAIL PROTECTED]
 Dmitriy S. Sinyavskiy
 Web-developer            Perl, Catalyst, MSSQL
 FGUE EZAN                Telecommunication, data transfer networks and 
devices.                      


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to