7 my $u = URI->new("", "http");
10 $u->query_form(a => 3, b => 4);
12 print "not " unless $u eq "?a=3&b=4";
15 $u->query_form(a => undef);
16 print "not " unless $u eq "?a=";
19 $u->query_form("a[=&+#] " => " [=&+#]");
20 print "not " unless $u eq "?a%5B%3D%26%2B%23%5D+=+%5B%3D%26%2B%23%5D";
24 print "not " unless join(":", @q) eq "a[=&+#] : [=&+#]";
27 @q = $u->query_keywords;
31 $u->query_keywords("a", "b");
32 print "not " unless $u eq "?a+b";
35 $u->query_keywords(" ", "+", "=", "[", "]");
36 print "not " unless $u eq "?%20+%2B+%3D+%5B+%5D";
39 @q = $u->query_keywords;
40 print "not " unless join(":", @q) eq " :+:=:[:]";
48 print "not " unless $u eq "?%20+?=%23";
51 $u->query_keywords([qw(a b)]);
52 print "not " unless $u eq "?a+b";
55 $u->query_keywords([]);
56 print "not " unless $u eq "";
59 $u->query_form({ a => 1, b => 2 });
60 print "not " unless $u eq "?a=1&b=2" || $u eq "?b=2&a=1";
63 $u->query_form([ a => 1, b => 2 ]);
64 print "not " unless $u eq "?a=1&b=2";
68 print "not " unless $u eq "";
71 $u->query_form([a => [1..4]]);
72 print "not " unless $u eq "?a=1&a=2&a=3&a=4";
76 print "not " unless $u eq "";
79 $u->query_form(a => { foo => 1 });
80 print "not " unless "$u" =~ /^\?a=HASH\(/;
84 # Some debugging while writing new tests
85 print "\@q='", join(":", @q), "'\n";