Permalink
Browse files

Adjust tests for query_form

  • Loading branch information...
1 parent 7594213 commit dadef8c55c33367c2eac98529dcd170ad0d22752 @gisle gisle committed Jan 22, 2011
Showing with 6 additions and 3 deletions.
  1. +1 −1 t/old-base.t
  2. +5 −2 t/query.t
View
@@ -346,7 +346,7 @@ sub parts_test {
die "\$url->query_form did not work"
unless $a{a} eq 'foo' && $a{b} eq 'bar';
- $url->query_form(a => undef, a => 'foo', '&=' => '&=+');
+ $url->query_form(a => '', a => 'foo', '&=' => '&=+');
$url->_expect('as_string' => 'http://web?a=&a=foo&%26%3D=%26%3D%2B');
my @a = $url->query_form;
View
@@ -1,7 +1,7 @@
#!perl -w
use strict;
-use Test::More tests => 23;
+use Test::More tests => 24;
use URI ();
my $u = URI->new("", "http");
@@ -11,6 +11,9 @@ $u->query_form(a => 3, b => 4);
is $u, "?a=3&b=4";
$u->query_form(a => undef);
+is $u, "?a";
+
+$u->query_form(a => '');
is $u, "?a=";
$u->query_form("a[=&+#] " => " [=&+#]");
@@ -32,7 +35,7 @@ is $u, "?%20+%2B+%3D+%5B+%5D";
is join(":", @q), " :+:=:[:]";
@q = $u->query_form;
-ok !@q;
+is_deeply \@q, [' + = [ ]', undef];
$u->query(" +?=#");
is $u, "?%20+?=%23";

0 comments on commit dadef8c

Please sign in to comment.