use_ok('TestApp');
my $request = Catalyst::Request->new( {
+ _log => Catalyst::Log->new,
base => URI->new('http://127.0.0.1/foo')
} );
my $dispatcher = TestApp->dispatcher;
'Plus is not encoded'
);
+TODO: {
+ local $TODO = 'broken by 5.7008';
+ is(
+ Catalyst::uri_for( $context, '/bar#fragment', { param1 => 'value1' } )->as_string,
+ 'http://127.0.0.1/foo/bar?param1=value1#fragment',
+ 'URI for path with fragment and query params'
+ );
+}
+
# test with utf-8
is(
Catalyst::uri_for( $context, 'quux', { param1 => "\x{2620}" } )->as_string,
);
}
-done_testing;
+{
+ package MyStringThing;
+ use overload '""' => sub { $_[0]->{string} }, fallback => 1;
+}
+
+is(
+ Catalyst::uri_for( $context, bless( { string => 'test' }, 'MyStringThing' ) ),
+ 'http://127.0.0.1/test',
+ 'overloaded object handled correctly'
+);
+
+done_testing;