From e2981a3cf12952614813d68619ad9a7b1c031ff0 Mon Sep 17 00:00:00 2001 From: Eric Johnson Date: Tue, 7 Nov 2017 13:58:30 -0500 Subject: [PATCH] Eric/perl 5.26.0 (#4529) * perl-5.26.0: Handle NaN * perl-5.26.0: regexp escaping * fix typo * bump travis to perl-5.26.0 * perl-5.26.0: unicode changed * revert to perl5.16 * cache perl-5.26/lib --- .travis.yml | 3 ++- lib/DDG/Goodie/Combination.pm | 2 +- lib/DDG/Goodie/RandomDate.pm | 2 +- t/Unicode.t | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e937369b6..910144d68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ cache: - $HOME/.cpanm - $HOME/.nvm - $HOME/perl5/perlbrew/perls/5.16/lib + - $HOME/perl5/perlbrew/perls/5.26/lib - /var/tmp addons: apt_packages: @@ -23,7 +24,7 @@ install: - dzil listdeps | grep -ve '^\W' | cpanm --quiet --notest --mirror http://www.cpan.org --mirror http://duckpan.org --mirror-only language: perl perl: - - 5.16 + - 5.26 script: - jasmine-node --test-dir spec/ - prove -lr -j1 t diff --git a/lib/DDG/Goodie/Combination.pm b/lib/DDG/Goodie/Combination.pm index 0e248f28c..6eefa1920 100755 --- a/lib/DDG/Goodie/Combination.pm +++ b/lib/DDG/Goodie/Combination.pm @@ -47,7 +47,7 @@ handle query => sub { } #Return no result if overflow - return if $result eq '-nan' or $result eq 'nan'; + return if $result eq '-nan' or $result eq 'nan' or $result eq 'NaN'; my $formatted_result = $style->for_display($result); diff --git a/lib/DDG/Goodie/RandomDate.pm b/lib/DDG/Goodie/RandomDate.pm index ef34e6040..79eba7955 100644 --- a/lib/DDG/Goodie/RandomDate.pm +++ b/lib/DDG/Goodie/RandomDate.pm @@ -48,7 +48,7 @@ my %supports_range = map { $_ => $date_re } ( my @standard_query_forms = keys %standard_queries; my @blacklist = ( - '\\%{[^}]*}', # Access to any DateTime method. + '\\%\\{[^}]*\\}', # Access to any DateTime method. ); my $blacklist_re = join '|', map { "($_)" } @blacklist; diff --git a/t/Unicode.t b/t/Unicode.t index 5db407b3e..3b2d50b5d 100644 --- a/t/Unicode.t +++ b/t/Unicode.t @@ -33,10 +33,10 @@ ddg_goodie_test( "utf-16 smile" => test_zci("\x{2323} U+2323 SMILE, decimal: 8995, HTML: ⌣, UTF-8: 0xE2 0x8C 0xA3, block: Miscellaneous Technical"), # Lookup by name, "utf-32 custard" - "utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: 🍮, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols And Pictographs"), + "utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: 🍮, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols and Pictographs"), # Lookup by name, "emoji rocket" - "emoji rocket" => test_zci("\x{1F680} U+1F680 ROCKET, decimal: 128640, HTML: 🚀, UTF-8: 0xF0 0x9F 0x9A 0x80, block: Transport And Map Symbols"), + "emoji rocket" => test_zci("\x{1F680} U+1F680 ROCKET, decimal: 128640, HTML: 🚀, UTF-8: 0xF0 0x9F 0x9A 0x80, block: Transport and Map Symbols"), # Lookup by character, "unicode à" "unicode \x{263B}" => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: ☻, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"),