summaryrefslogtreecommitdiff
path: root/t/sort-hash-query-form.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-07-25 01:06:42 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-07-25 01:06:42 +0000
commit9165b237ad8fae18b36d4d40d6e2ccfde7b136c7 (patch)
tree06530ddd6baa7e251c58b6b6729ed458da61a681 /t/sort-hash-query-form.t
downloadURI-tarball-master.tar.gz
Diffstat (limited to 't/sort-hash-query-form.t')
-rw-r--r--t/sort-hash-query-form.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/sort-hash-query-form.t b/t/sort-hash-query-form.t
new file mode 100644
index 0000000..7c6f896
--- /dev/null
+++ b/t/sort-hash-query-form.t
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+# ABSTRACT: Make sure query_form(\%hash) is sorted
+
+use URI;
+
+my $base = URI->new('http://example.org/');
+
+my $i = 1;
+
+my $hash = { map { $_ => $i++ } qw( a b c d e f ) };
+
+$base->query_form($hash);
+
+is("$base","http://example.org/?a=1&b=2&c=3&d=4&e=5&f=6", "Query parameters are sorted");
+
+done_testing;
+
+