[Jifty-commit] r1067 - in jifty/trunk: lib/Jifty/Request t/Continuations/t t/Mapper/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon May 15 17:28:33 EDT 2006


Author: alexmv
Date: Mon May 15 17:28:32 2006
New Revision: 1067

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Request/Mapper.pm
   jifty/trunk/t/Continuations/t/01-raw-api.t
   jifty/trunk/t/Mapper/t/01-raw-api.t

Log:
 r13020 at zoq-fot-pik:  chmrr | 2006-05-15 17:26:31 -0400
  * Don't use the same escape character for mapping as we use for
 submit query argument joining


Modified: jifty/trunk/lib/Jifty/Request/Mapper.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Request/Mapper.pm	(original)
+++ jifty/trunk/lib/Jifty/Request/Mapper.pm	Mon May 15 17:28:32 2006
@@ -82,7 +82,7 @@
 
                 my $type = ($_ =~ /result/) ? "R" : "A";
 
-                $return{"J:M-$key"} = join("|", $type, $moniker, $name);
+                $return{"J:M-$key"} = join("`", $type, $moniker, $name);
             }
         } else {
             $return{$key} = $parameters{$key};
@@ -141,7 +141,7 @@
 
     my $destination = $1;
 
-    my @bits = split( /\|/, $args{source} );
+    my @bits = split( /\`/, $args{source} );
     if ( $bits[0] ) {
         if ( $bits[0] eq "A" and @bits == 3 ) {
             return ( $destination => undef ) unless $args{request}->action( $bits[1] );

Modified: jifty/trunk/t/Continuations/t/01-raw-api.t
==============================================================================
--- jifty/trunk/t/Continuations/t/01-raw-api.t	(original)
+++ jifty/trunk/t/Continuations/t/01-raw-api.t	Mon May 15 17:28:32 2006
@@ -41,25 +41,25 @@
 ok($mech->continuation, "With a continuation set");
 
 # Create a continuation using with return values
-$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A|bar;J:PATH=/index-help.html");
+$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A`bar;J:PATH=/index-help.html");
 like($mech->uri, qr/index-help.html/, "Got to new page");
 $mech->content_like(qr/help about the index/i, "Correct content on new page");
 ok($mech->continuation, "With a continuation set");
 my $first = $mech->continuation->id;
 
 # Hit same URL again
-$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A|bar;J:PATH=/index-help.html");
+$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A`bar;J:PATH=/index-help.html");
 ok($mech->continuation, "Also sets a continuation");
 isnt($first, $mech->continuation->id, "Different continuation this time");
 
 # Create continuation from submit with an action
-$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A|bar;J:PATH=/index-help.html;J:A-grail=GetGrail");
+$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A`bar;J:PATH=/index-help.html;J:A-grail=GetGrail");
 $mech->content_unlike(qr/got the grail/i, "Action didn't run");
 ok($mech->continuation->request->action("grail"), "Continuation has the action stored");
 my $pending = $mech->continuation->id;
 
 # Create continuation from submit with action that doesn't validate
-$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A|bar;J:PATH=/index-help.html;J:A-cross=CrossBridge");
+$mech->get("$URL/index.html?J:CREATE=1;J:M-foo=A`bar;J:PATH=/index-help.html;J:A-cross=CrossBridge");
 $mech->content_unlike(qr/crossed the bridge/i, "action didn't run");
 ok($mech->continuation->response->result("cross")->failure, "Action's result was failure");
 
@@ -99,7 +99,7 @@
 
 #### Nesting
 # Inside one of the existing conts, create a new cont
-$mech->get("$URL/index-help.html?J:C=$first;J:CREATE=1;J:M-troz=A|zort;J:PATH=/help-help.html");
+$mech->get("$URL/index-help.html?J:C=$first;J:CREATE=1;J:M-troz=A`zort;J:PATH=/help-help.html");
 like($mech->uri, qr/help-help.html/, "Got to new page");
 $mech->content_like(qr/help about help/i, "Correct content on new page");
 ok($mech->continuation, "With a continuation set");
@@ -118,7 +118,7 @@
 
 #### Nested returns
 # Inside one of the existing conts, create a new cont with a CALL at the same time
-$mech->get("$URL/index-help.html?J:CALL=$first;J:CREATE=1;J:M|troz=A-zort;J:PATH=/help-help.html");
+$mech->get("$URL/index-help.html?J:CALL=$first;J:CREATE=1;J:M`troz=A-zort;J:PATH=/help-help.html");
 like($mech->uri, qr/help-help.html/, "Got to new page");
 $mech->content_like(qr/help about help/i, "Correct content on new page");
 ok($mech->continuation, "With a continuation set");

Modified: jifty/trunk/t/Mapper/t/01-raw-api.t
==============================================================================
--- jifty/trunk/t/Mapper/t/01-raw-api.t	(original)
+++ jifty/trunk/t/Mapper/t/01-raw-api.t	Mon May 15 17:28:32 2006
@@ -39,52 +39,52 @@
 
 
 #### Flat arguments
-$mech->get("$URL/index.html?J:M-foo=A|bar");
+$mech->get("$URL/index.html?J:M-foo=A`bar");
 $mech->content_like(qr/foo: ~/, "Passing no parameter sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bar;bar=baz");
+$mech->get("$URL/index.html?J:M-foo=A`bar;bar=baz");
 $mech->content_like(qr/foo: baz/, "Passing parameter sets to value");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bar;bar=baz;bar=troz");
+$mech->get("$URL/index.html?J:M-foo=A`bar;bar=baz;bar=troz");
 $mech->content_like(qr/bar: &1\s*\n\s+- baz\n\s+- troz/, "Multiple parameters are list");
 $mech->content_like(qr/foo: \*1/, "Multiple parameters are to same reference");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
 
 #### Action results
-$mech->get("$URL/index.html?J:M-foo=R|grail|bar");
+$mech->get("$URL/index.html?J:M-foo=R`grail`bar");
 $mech->content_like(qr/foo: ~/, "Action doesn't exist, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=R|grail|bar;J:A-grail=GetGrail");
+$mech->get("$URL/index.html?J:M-foo=R`grail`bar;J:A-grail=GetGrail");
 $mech->content_like(qr/foo: ~/, "Content name doesn't exist, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=R|grail|castle;J:A-grail=GetGrail");
+$mech->get("$URL/index.html?J:M-foo=R`grail`castle;J:A-grail=GetGrail");
 $mech->content_like(qr/foo: Aaaaaargh/, "Content name exists, sets to value");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
 
 #### Action arguments
-$mech->get("$URL/index.html?J:M-foo=A|bridge|bar");
+$mech->get("$URL/index.html?J:M-foo=A`bridge`bar");
 $mech->content_like(qr/foo: ~/, "Action doesn't exist, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bridge|bar;J:A-bridge=CrossBridge");
+$mech->get("$URL/index.html?J:M-foo=A`bridge`bar;J:A-bridge=CrossBridge");
 $mech->content_like(qr/foo: ~/, "Argument name doesn't exist, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bridge|quest;J:A-bridge=CrossBridge");
+$mech->get("$URL/index.html?J:M-foo=A`bridge`quest;J:A-bridge=CrossBridge");
 $mech->content_like(qr/foo: ~/, "Argument is valid but missing, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bridge|name;J:A-bridge=CrossBridge");
+$mech->get("$URL/index.html?J:M-foo=A`bridge`name;J:A-bridge=CrossBridge");
 $mech->content_like(qr/foo: ~/, "Argument is valid with default_value but missing, sets to undef");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
-$mech->get("$URL/index.html?J:M-foo=A|bridge|quest;J:A-bridge=CrossBridge;J:A:F-quest-bridge=grail");
+$mech->get("$URL/index.html?J:M-foo=A`bridge`quest;J:A-bridge=CrossBridge;J:A:F-quest-bridge=grail");
 $mech->content_like(qr/foo: grail/, "Argument is valid, sets to submitted value");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 


More information about the Jifty-commit mailing list