From 4ab99e37e6418397402b5c1dbd68f44b7d70baed Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 24 Nov 2012 12:49:51 -0600 Subject: fix hash order dependency for blead --- t/response.t | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 't') 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; -- cgit v1.2.3-54-g00ecf