From: Shlomi Fish Date: Wed, 29 Apr 2020 12:19:38 +0000 (+0300) Subject: Refactoring / code cleanup. X-Git-Tag: fortune-mod-2.22.0~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79c254be524751b31ad9553edd157088d1523d65;p=fortune-mod Refactoring / code cleanup. See: * https://en.wikipedia.org/wiki/Code_refactoring * https://www.refactoring.com/ * https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/ Some small optimisations may have slipped in as well. --- diff --git a/fortune-mod/INDEX b/fortune-mod/INDEX index 2b74f48..8a5659c 100644 --- a/fortune-mod/INDEX +++ b/fortune-mod/INDEX @@ -1,4 +1,3 @@ - This is fortune-mod, an feature-enhanced fortune derived from sources found in NetBSD. You can also find out more about this package in the following files: diff --git a/fortune-mod/run-tests.pl b/fortune-mod/run-tests.pl index e0e491f..09df303 100644 --- a/fortune-mod/run-tests.pl +++ b/fortune-mod/run-tests.pl @@ -13,7 +13,7 @@ GetOptions( 'src-dir=s' => \$src_dir, ) or die "could not parse options - $!"; -if ( !defined $src_dir ) +if ( !defined($src_dir) ) { die "--src-dir was not defined"; } @@ -35,29 +35,10 @@ sub do_system } } -# Cancelling because it's now part of the prove-based tests. -if (0) -{ - do_system( { cmd => [ $^X, "$src_dir/tests/trailing-space-and-CRs.pl" ] } ); -} - -eval { - do_system( - { - cmd => [ - 'prove', ( $IS_WIN ? ("-v") : () ), - glob("$src_dir/tests/t/*.t") - ] - } - ); -}; - -my $E = $@; -if ( $ENV{FORTUNE_TEST_DEBUG} ) -{ - system( "python", "$src_dir/tests/fortune-m-test.py" ); -} -if ($E) -{ - die $E; -} +do_system( + { + cmd => [ + 'prove', ( $IS_WIN ? ("-v") : () ), glob("$src_dir/tests/t/*.t") + ] + } +);