From 97b79f4dccb6f9ed2f2ed9e3aace2336475cc260 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Thu, 27 Jun 2024 12:23:33 +0200 Subject: [PATCH] Fixing useless testing of the next character being a review one. --- t/01-characters.t | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/t/01-characters.t b/t/01-characters.t index ac4bb40..cd574e6 100644 --- a/t/01-characters.t +++ b/t/01-characters.t @@ -30,11 +30,12 @@ BEGIN { return 100; }); my $mock_characters = Test::MockModule->new('JapaChar::Characters'); - my $called_next_review_char = 0; + my $next_review_char = undef; $mock_characters->mock(_next_review_char => sub { - $called_next_review_char = 1; - return $mock_characters->original('_next_review_char')->(@_); + $next_review_char = $mock_characters->original('_next_review_char')->(@_); + return $next_review_char; }); - ok defined(JapaChar::Characters->new->next_char), 'The next char is defined.'; - ok $called_next_review_char, 'The next char is a review.'; + my $next_char = JapaChar::Characters->new->next_char; + ok defined($next_char), 'The next char is defined.'; + is_deeply $next_review_char, $next_char, 'The next char is a review one.'; }