change the way we do this logic for older perl compat
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_uri_for.t
index 6732024..a541508 100644 (file)
@@ -59,14 +59,23 @@ is(
     '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'
-    );
-}
+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 1'
+);
+
+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 3'
+);
+
+is(
+    Catalyst::uri_for( $context, '/foo#bar/baz', { param1 => 'value1' } )->as_string,
+    'http://127.0.0.1/foo/foo?param1=value1#bar/baz',
+    'URI for path with fragment and query params 3'
+);
 
 # test with utf-8
 is(
@@ -181,5 +190,16 @@ TODO: {
     );
 }
 
-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;