From 33c0d7957882883f88e3ef1affe8203f2bbc4dde Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Thu, 2 Mar 2023 11:57:12 +0100 Subject: fix pagination test --- t/Helper.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 't/Helper.t') diff --git a/t/Helper.t b/t/Helper.t index 45d0e4f..4578594 100644 --- a/t/Helper.t +++ b/t/Helper.t @@ -83,7 +83,7 @@ sub _to_perl_enc { subtest 'pagination' => sub { my %res; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 0, page_size => 10, total_items => 55); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 0, page_size => 10, total_items => 55)->%*; is $res{first_item}, 0; is $res{last_item}, 9; @@ -98,7 +98,7 @@ subtest 'pagination' => sub { is_deeply $res{next_page}, [10, 20], 'next'; is_deeply $res{last_page}, [50, 55], 'last'; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 10, page_size => 10, total_items => 55); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 10, page_size => 10, total_items => 55)->%*; is $res{first_item}, 10; is $res{last_item}, 19; @@ -113,7 +113,7 @@ subtest 'pagination' => sub { is_deeply $res{next_page}, [20, 30], 'next'; is_deeply $res{last_page}, [50, 55], 'last'; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 20, page_size => 10, total_items => 55); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 20, page_size => 10, total_items => 55)->%*; is $res{first_item}, 20; is $res{last_item}, 29; @@ -128,7 +128,7 @@ subtest 'pagination' => sub { is_deeply $res{next_page}, [30, 40], 'next'; is_deeply $res{last_page}, [50, 55], 'last'; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 50, page_size => 10, total_items => 55); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 50, page_size => 10, total_items => 55)->%*; is $res{first_item}, 50; is $res{last_item}, 54; @@ -143,7 +143,7 @@ subtest 'pagination' => sub { is_deeply $res{next_page}, [50, 55], 'next'; is_deeply $res{last_page}, [50, 55], 'last'; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 0, page_size => 10, total_items => 0); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 0, page_size => 10, total_items => 0)->%*; ok !defined $res{first_item}; ok !defined $res{last_item}; @@ -161,7 +161,7 @@ subtest 'pagination' => sub { SKIP: { skip 'The first_item does not align with page boundaries and behaiviour is not specified.'; - %res = JWebmail::Plugin::Helper::_paginate(first_item => 19, page_size => 10, total_items => 55); + %res = JWebmail::Plugin::Helper::_paginate(first_item => 19, page_size => 10, total_items => 55)->%*; is $res{first_item}, 20; is $res{last_item}, 29; -- cgit v1.2.3