summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-11-24 12:49:51 -0600
committerJesse Luehrs <doy@tozt.net>2012-11-24 12:49:51 -0600
commit4ab99e37e6418397402b5c1dbd68f44b7d70baed (patch)
tree46cdb84aaff534fd74aee2ae79a27f7778609487
parentf3a90c74f065371df902c9dcae19105a9ca0e3bd (diff)
downloadweb-request-4ab99e37e6418397402b5c1dbd68f44b7d70baed.tar.gz
web-request-4ab99e37e6418397402b5c1dbd68f44b7d70baed.zip
fix hash order dependency for blead
-rw-r--r--t/response.t55
1 files changed, 29 insertions, 26 deletions
diff --git a/t/response.t b/t/response.t
index eedf540..5e6e1cd 100644
--- a/t/response.t
+++ b/t/response.t
@@ -21,33 +21,36 @@ is_deeply(
),
[ 200, +[], [ 'hello' ] ]
);
-is_deeply(
- res(
- status => 200,
- cookies => +{
- 'foo_sid' => +{
- value => 'ASDFJKL:',
- expires => 'Thu, 25-Apr-1999 00:40:33 GMT',
- domain => 'example.com',
- path => '/',
- },
- 'poo_sid' => +{
- value => 'QWERTYUI',
- expires => 'Thu, 25-Apr-1999 00:40:33 GMT',
- domain => 'example.com',
- path => '/',
- },
+
+my $res = res(
+ status => 200,
+ cookies => +{
+ 'foo_sid' => +{
+ value => 'ASDFJKL:',
+ expires => 'Thu, 25-Apr-1999 00:40:33 GMT',
+ domain => 'example.com',
+ path => '/',
},
- content => 'hello',
- ),
- [
- 200,
- +[
- 'Set-Cookie' => 'poo_sid=QWERTYUI; domain=example.com; path=/; expires=Thu, 25-Apr-1999 00:40:33 GMT',
- 'Set-Cookie' => 'foo_sid=ASDFJKL%3A; domain=example.com; path=/; expires=Thu, 25-Apr-1999 00:40:33 GMT',
- ],
- [ 'hello' ],
- ]
+ 'poo_sid' => +{
+ value => 'QWERTYUI',
+ expires => 'Thu, 25-Apr-1999 00:40:33 GMT',
+ domain => 'example.com',
+ path => '/',
+ },
+ },
+ content => 'hello',
);
+is($res->[0], 200);
+
+is(scalar(@{ $res->[1] }), 4);
+is($res->[1][0], 'Set-Cookie');
+is($res->[1][2], 'Set-Cookie');
+my @cookies = sort($res->[1][1], $res->[1][3]);
+is($cookies[0], 'foo_sid=ASDFJKL%3A; domain=example.com; path=/; expires=Thu, 25-Apr-1999 00:40:33 GMT');
+is($cookies[1], 'poo_sid=QWERTYUI; domain=example.com; path=/; expires=Thu, 25-Apr-1999 00:40:33 GMT');
+
+is(scalar(@{ $res->[2] }), 1);
+is($res->[2][0], 'hello');
+
done_testing;