diff --git a/t/ABC.t b/t/ABC.t index 0d4601bdb..759095b78 100755 --- a/t/ABC.t +++ b/t/ABC.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'choice'; @@ -12,7 +13,7 @@ sub create_structured_answer { my $data = shift; return { - data => $data, #'-ANY-', + data => $data, #ignore(), templates => { group => 'text', moreAt => 0 @@ -30,28 +31,28 @@ ddg_goodie_test( 'choose his or or her house' => undef, 'choose from products like turkey or venison' => undef, 'choose pick or axe' => test_zci( - qr/(pick|axe) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(pick|axe) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'choose yes or no' => test_zci( - qr/(yes|no) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(yes|no) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'choose this or that or none' => test_zci( - qr/(this|that|none) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(this|that|none) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'pick this or that or none' => test_zci( - qr/(this|that|none) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(this|that|none) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'select heads or tails' => test_zci( - qr/(heads|tails) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(heads|tails) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'choose heads or tails' => test_zci( - qr/(heads|tails) \(Random\)/, - structured_answer => create_structured_answer('-ANY-') + re(qr/(heads|tails) \(Random\)/), + structured_answer => create_structured_answer(ignore()) ), 'choose duckduckgo or google or bing or something' => test_zci( 'duckduckgo (Non-random)', @@ -70,4 +71,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/AltCalendars.t b/t/AltCalendars.t index c38016a41..203ab74a2 100644 --- a/t/AltCalendars.t +++ b/t/AltCalendars.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'date_conversion'; @@ -84,4 +85,4 @@ sub make_structured_answer { }; }; -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Anagram.t b/t/Anagram.t index 54d158988..345aed433 100644 --- a/t/Anagram.t +++ b/t/Anagram.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'anagram'; @@ -42,4 +43,4 @@ ddg_goodie_test( 'anagrams of "Mixing it up"' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/AspectRatio.t b/t/AspectRatio.t index a5df07e7a..a83801717 100644 --- a/t/AspectRatio.t +++ b/t/AspectRatio.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'aspect_ratio'; @@ -33,4 +34,4 @@ ddg_goodie_test( 'aspect ratio 1:1.5 ?:15' => build_test('1:1.5', '10:15') ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Atbash.t b/t/Atbash.t index dabe896b5..1b08554c3 100755 --- a/t/Atbash.t +++ b/t/Atbash.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'atbash'; @@ -92,4 +93,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Average.t b/t/Average.t index 48afc131a..ea25210ab 100644 --- a/t/Average.t +++ b/t/Average.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'average'; @@ -42,4 +43,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/BPMToMs.t b/t/BPMToMs.t index 97402e616..d31d558a7 100644 --- a/t/BPMToMs.t +++ b/t/BPMToMs.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "bpmto_ms"; @@ -30,49 +31,49 @@ ddg_goodie_test( "120 beats per minute to ms" => test_zci( $plaintext_120, structured_answer => { - data => '-ANY-', + data => ignore(), # [ # { # note_type => "Whole Note", # triplet => 1333, # dotted => 3000, # milliseconds => 2000, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "Half Note", # triplet => 667, # dotted => 1500, # milliseconds => 1000, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "Quarter Note", # triplet => 333, # dotted => 750, # milliseconds => 500, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/8 Note", # triplet => 167, # dotted => 375, # milliseconds => 250, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/16 Note", # triplet => 83, # dotted => 188, # milliseconds => 125, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/32 Note", # triplet => 42, # dotted => 94, # milliseconds => 63, -# image => qr/.*/ +# image => re(qr/.*/) # } # ], meta => { @@ -92,49 +93,49 @@ ddg_goodie_test( "61 beats per minute to ms" => test_zci( $plaintext_61, structured_answer => { - data => '-ANY-', + data => ignore(), # [ # { # note_type => "Whole Note", # triplet => 2623, # dotted => 5902, # milliseconds => 3934, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "Half Note", # triplet => 1311, # dotted => 2951, # milliseconds => 1967, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "Quarter Note", # triplet => 656, # dotted => 1475, # milliseconds => 984, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/8 Note", # triplet => 328, # dotted => 738, # milliseconds => 492, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/16 Note", # triplet => 164, # dotted => 369, # milliseconds => 246, -# image => qr/.*/ +# image => re(qr/.*/) # }, # { # note_type => "1/32 Note", # triplet => 82, # dotted => 184, # milliseconds => 123, -# image => qr/.*/ +# image => re(qr/.*/) # } # ], meta => { @@ -156,4 +157,4 @@ ddg_goodie_test( 'bpm' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BRT.t b/t/BRT.t index 9a90bb1ad..5fae6b456 100644 --- a/t/BRT.t +++ b/t/BRT.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "brt"; @@ -30,4 +31,4 @@ ddg_goodie_test( "brt 12345678901234567890" => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Base.t b/t/Base.t index 24e282f42..d36921eaa 100644 --- a/t/Base.t +++ b/t/Base.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'conversion'; @@ -39,4 +40,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Base64.t b/t/Base64.t index 413a402b9..e0b6bc729 100644 --- a/t/Base64.t +++ b/t/Base64.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'base64_conversion'; @@ -45,4 +46,4 @@ ddg_goodie_test( "base64 decode" => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BashPrimaryExpressions.t b/t/BashPrimaryExpressions.t index dbc107bd7..bd366d116 100644 --- a/t/BashPrimaryExpressions.t +++ b/t/BashPrimaryExpressions.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'expression_description'; @@ -12,7 +13,7 @@ ddg_goodie_test( 'DDG::Goodie::BashPrimaryExpressions' ], "bash [ -a b ]" => test_zci( - qr/.+ true if b exists./, + re(qr/.+ true if b exists./), structured_answer => { data => { intro => "[ -a b ]", @@ -39,9 +40,9 @@ ddg_goodie_test( } ), 'bash [[ "abc" < "cba" ]]' => test_zci( - qr/.+ true if "abc" string-sorts before "cba" in the current locale./, + re(qr/.+ true if "abc" string-sorts before "cba" in the current locale./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -52,9 +53,9 @@ ddg_goodie_test( } ), 'bash [ 2 -gt 1 ]' => test_zci( - qr/.+ true if 2 is numerically greater than 1./, + re(qr/.+ true if 2 is numerically greater than 1./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -65,9 +66,9 @@ ddg_goodie_test( } ), 'bash [ ! hello == world ]' => test_zci( - qr/.+ false if the strings hello and world are equal./, + re(qr/.+ false if the strings hello and world are equal./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -78,9 +79,9 @@ ddg_goodie_test( } ), 'bash [[ /tmp/hello -nt /etc/test ]]' => test_zci ( - qr#.+ true if /tmp/hello has been changed more recently than /etc/test or if /tmp/hello exists and /etc/test does not.#, + re(qr#.+ true if /tmp/hello has been changed more recently than /etc/test or if /tmp/hello exists and /etc/test does not.#), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -91,9 +92,9 @@ ddg_goodie_test( } ), 'bash [ -z hello ]' => test_zci( - qr/.+ true if the length of 'hello' is zero./, + re(qr/.+ true if the length of 'hello' is zero./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -104,9 +105,9 @@ ddg_goodie_test( } ), 'bash if [[ "abc" -lt "cba" ]]' => test_zci( - qr/.+ true if "abc" is numerically less than "cba"./, + re(qr/.+ true if "abc" is numerically less than "cba"./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -120,4 +121,4 @@ ddg_goodie_test( 'bash if [ ![ 1 -lt 2 ] ]' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BeamMeUpScotty.t b/t/BeamMeUpScotty.t index f1a645a01..389b850ea 100644 --- a/t/BeamMeUpScotty.t +++ b/t/BeamMeUpScotty.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "beam_me_up_scotty"; @@ -32,4 +33,4 @@ ddg_goodie_test( 'scotty beam us up' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Bin2Unicode.t b/t/Bin2Unicode.t index 5ff9bf030..4a70adb71 100644 --- a/t/Bin2Unicode.t +++ b/t/Bin2Unicode.t @@ -1,6 +1,7 @@ #!/usr/bin/env perl use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -77,4 +78,4 @@ ddg_goodie_test( %ctrl_tests ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Binary.t b/t/Binary.t index d4225b10c..2257ccb80 100644 --- a/t/Binary.t +++ b/t/Binary.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'binary_conversion'; @@ -56,4 +57,4 @@ ddg_goodie_test( 'to binary' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BinaryLogic.t b/t/BinaryLogic.t index fbcb2d420..3b39d60f0 100755 --- a/t/BinaryLogic.t +++ b/t/BinaryLogic.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -65,4 +66,4 @@ ddg_goodie_test( 'what do number and letter codes in a lens name mean' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BirthStone.t b/t/BirthStone.t index 7600209b2..add7946d8 100644 --- a/t/BirthStone.t +++ b/t/BirthStone.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "birth_stone"; @@ -35,4 +36,4 @@ ddg_goodie_test( 'may birth stone' => build_test('May', 'Emerald') ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Bitsum.t b/t/Bitsum.t index 9762c5155..bc107b31f 100644 --- a/t/Bitsum.t +++ b/t/Bitsum.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "bitsum"; @@ -46,4 +47,4 @@ ddg_goodie_test( 'bitsum 0b' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/BloodDonor.t b/t/BloodDonor.t index 7f326b865..22a0ddc69 100755 --- a/t/BloodDonor.t +++ b/t/BloodDonor.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "blood_donor"; @@ -89,4 +90,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Braille.t b/t/Braille.t index d853f6d05..3175b23e8 100644 --- a/t/Braille.t +++ b/t/Braille.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Convert::Braille; use utf8; @@ -43,4 +44,4 @@ ddg_goodie_test( 'braille to braille is good' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CaesarCipher.t b/t/CaesarCipher.t index e7eedede5..e5e79b1f8 100644 --- a/t/CaesarCipher.t +++ b/t/CaesarCipher.t @@ -3,13 +3,14 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'caesar_cipher'; zci is_cached => 1; my $decode_response = { - data => '-ANY-', # We only need to check it is the right template. + data => ignore(), # We only need to check it is the right template. meta => { sourceUrl => 'https://en.wikipedia.org/wiki/Caesar_cipher', sourceName => 'Wikipedia', @@ -70,4 +71,4 @@ ddg_goodie_test( 'how to decode caesar' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CalcRoots.t b/t/CalcRoots.t index ef1149ee8..e0086a5a2 100644 --- a/t/CalcRoots.t +++ b/t/CalcRoots.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'root'; @@ -49,4 +50,4 @@ ddg_goodie_test( } ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Calculator.t b/t/Calculator.t index 86313a896..a2bb88991 100644 --- a/t/Calculator.t +++ b/t/Calculator.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use DDG::Goodie::Calculator; # For function subtests. use utf8; @@ -18,7 +19,7 @@ ddg_goodie_test( structured_answer => { input => ['2 - 2'], operation => 'Calculate', - result => qr/>0 re(qr/>0 test_zci( @@ -27,7 +28,7 @@ ddg_goodie_test( structured_answer => { input => ['2 + 2'], operation => 'Calculate', - result => qr/>4 re(qr/>4 test_zci( @@ -36,7 +37,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 8'], operation => 'Calculate', - result => qr/>256 re(qr/>256 test_zci( @@ -45,7 +46,7 @@ ddg_goodie_test( structured_answer => { input => ['2 * 7'], operation => 'Calculate', - result => qr/>14 re(qr/>14 test_zci( @@ -54,7 +55,7 @@ ddg_goodie_test( structured_answer => { input => ['4 * 5'], operation => 'Calculate', - result => qr/>20 re(qr/>20 test_zci( @@ -63,7 +64,7 @@ ddg_goodie_test( structured_answer => { input => ['6 * 7'], operation => 'Calculate', - result => qr/>42 re(qr/>42 test_zci( @@ -72,7 +73,7 @@ ddg_goodie_test( structured_answer => { input => ['3 * dozen'], operation => 'Calculate', - result => qr/>36 re(qr/>36 test_zci( @@ -81,7 +82,7 @@ ddg_goodie_test( structured_answer => { input => ['dozen / 4'], operation => 'Calculate', - result => qr/>3 re(qr/>3 test_zci( @@ -90,7 +91,7 @@ ddg_goodie_test( structured_answer => { input => ['1 dozen * 2'], operation => 'Calculate', - result => qr/>24 re(qr/>24 test_zci( @@ -99,7 +100,7 @@ ddg_goodie_test( structured_answer => { input => ['dozen + dozen'], operation => 'Calculate', - result => qr/>24 re(qr/>24 test_zci( @@ -108,7 +109,7 @@ ddg_goodie_test( structured_answer => { input => ['2 divided by 4'], operation => 'Calculate', - result => qr/>0.5 re(qr/>0.5 test_zci( @@ -117,7 +118,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 2'], operation => 'Calculate', - result => qr/>4 re(qr/>4 test_zci( @@ -126,7 +127,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 0.2'], operation => 'Calculate', - result => qr/>1\.14869835499704 re(qr/>1\.14869835499704 test_zci( @@ -135,7 +136,7 @@ ddg_goodie_test( structured_answer => { input => ['cos(0)'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -144,7 +145,7 @@ ddg_goodie_test( structured_answer => { input => ['tan(1)'], operation => 'Calculate', - result => qr/>1\.5574077246549 re(qr/>1\.5574077246549 test_zci( @@ -153,7 +154,7 @@ ddg_goodie_test( structured_answer => { input => ['tanh(1)'], operation => 'Calculate', - result => qr/>0\.761594155955765 re(qr/>0\.761594155955765 test_zci( @@ -162,7 +163,7 @@ ddg_goodie_test( structured_answer => { input => ['cotan(1)'], operation => 'Calculate', - result => qr/>0\.642092615934331 re(qr/>0\.642092615934331 test_zci( @@ -171,7 +172,7 @@ ddg_goodie_test( structured_answer => { input => ['sin(1)'], operation => 'Calculate', - result => qr/>0\.841470984807897 re(qr/>0\.841470984807897 test_zci( @@ -180,7 +181,7 @@ ddg_goodie_test( structured_answer => { input => ['csc(1)'], operation => 'Calculate', - result => qr/>1\.18839510577812 re(qr/>1\.18839510577812 test_zci( @@ -189,7 +190,7 @@ ddg_goodie_test( structured_answer => { input => ['sec(1)'], operation => 'Calculate', - result => qr/>1\.85081571768093 re(qr/>1\.85081571768093 test_zci( @@ -198,7 +199,7 @@ ddg_goodie_test( structured_answer => { input => ['log(3)'], operation => 'Calculate', - result => qr/>1\.09861228866811 re(qr/>1\.09861228866811 test_zci( @@ -207,7 +208,7 @@ ddg_goodie_test( structured_answer => { input => ['log(3)'], operation => 'Calculate', - result => qr/>1\.09861228866811 re(qr/>1\.09861228866811 test_zci( @@ -216,7 +217,7 @@ ddg_goodie_test( structured_answer => { input => ['log10(100.00)'], operation => 'Calculate', - result => qr/>2 re(qr/>2 test_zci( @@ -225,7 +226,7 @@ ddg_goodie_test( structured_answer => { input => ['log_10(100.00)'], operation => 'Calculate', - result => qr/>2 re(qr/>2 test_zci( @@ -234,7 +235,7 @@ ddg_goodie_test( structured_answer => { input => ['log_2(16)'], operation => 'Calculate', - result => qr/>4 re(qr/>4 test_zci( @@ -243,7 +244,7 @@ ddg_goodie_test( structured_answer => { input => ['log_23(25)'], operation => 'Calculate', - result => qr/>1\.0265928122321 re(qr/>1\.0265928122321 test_zci( @@ -252,7 +253,7 @@ ddg_goodie_test( structured_answer => { input => ['log23(25)'], operation => 'Calculate', - result => qr/>1\.0265928122321 re(qr/>1\.0265928122321 test_zci( @@ -261,7 +262,7 @@ ddg_goodie_test( structured_answer => { input => ['$3.43 + $34.45'], operation => 'Calculate', - result => qr/>\$37\.88 re(qr/>\$37\.88 test_zci( @@ -270,7 +271,7 @@ ddg_goodie_test( structured_answer => { input => ['$3.45 + $34.45'], operation => 'Calculate', - result => qr/>\$37\.90 re(qr/>\$37\.90 test_zci( @@ -279,7 +280,7 @@ ddg_goodie_test( structured_answer => { input => ['$3 + $34'], operation => 'Calculate', - result => qr/>\$37\.00 re(qr/>\$37\.00 test_zci( @@ -288,7 +289,7 @@ ddg_goodie_test( structured_answer => { input => ['$3,4 + $34,4'], operation => 'Calculate', - result => qr/>\$37,80 re(qr/>\$37,80 test_zci( @@ -297,7 +298,7 @@ ddg_goodie_test( structured_answer => { input => ['64 * 343'], operation => 'Calculate', - result => qr/>21,952 re(qr/>21,952 test_zci( @@ -306,7 +307,7 @@ ddg_goodie_test( structured_answer => { input => ['(1 * 10 ^ 2) + 1'], operation => 'Calculate', - result => qr/>101 re(qr/>101 test_zci( @@ -315,7 +316,7 @@ ddg_goodie_test( structured_answer => { input => ['1 + (1 * 10 ^ 2)'], operation => 'Calculate', - result => qr/>101 re(qr/>101 test_zci( @@ -324,7 +325,7 @@ ddg_goodie_test( structured_answer => { input => ['2 * 3 + (1 * 10 ^ 2)'], operation => 'Calculate', - result => qr/>106 re(qr/>106 test_zci( @@ -333,7 +334,7 @@ ddg_goodie_test( structured_answer => { input => ['(1 * 10 ^ 2) + 2 * 3'], operation => 'Calculate', - result => qr/>106 re(qr/>106 test_zci( @@ -342,7 +343,7 @@ ddg_goodie_test( structured_answer => { input => ['(1 * 10 ^ 2) / 2'], operation => 'Calculate', - result => qr/>50 re(qr/>50 test_zci( @@ -351,7 +352,7 @@ ddg_goodie_test( structured_answer => { input => ['2 / (1 * 10 ^ 2)'], operation => 'Calculate', - result => qr/>0\.02 re(qr/>0\.02 test_zci( @@ -360,7 +361,7 @@ ddg_goodie_test( structured_answer => { input => ['424334 + 2253828'], operation => 'Calculate', - result => qr/>2,678,162 re(qr/>2,678,162 test_zci( @@ -369,7 +370,7 @@ ddg_goodie_test( structured_answer => { input => ['4.243,34 + 22.538,28'], operation => 'Calculate', - result => qr/>26\.781,62 re(qr/>26\.781,62 test_zci( @@ -378,7 +379,7 @@ ddg_goodie_test( structured_answer => { input => ['sin(1,0) + 1,05'], operation => 'Calculate', - result => qr/>1,8914709848079 re(qr/>1,8914709848079 test_zci( @@ -387,7 +388,7 @@ ddg_goodie_test( structured_answer => { input => ['21 + 15 * 0 + 5'], operation => 'Calculate', - result => qr/>26 re(qr/>26 test_zci( @@ -396,7 +397,7 @@ ddg_goodie_test( structured_answer => { input => ['0.8158 - 0.8157'], operation => 'Calculate', - result => qr/>0\.0001 re(qr/>0\.0001 test_zci( @@ -405,7 +406,7 @@ ddg_goodie_test( structured_answer => { input => ['2,90 + 4,6'], operation => 'Calculate', - result => qr/>7,50 re(qr/>7,50 test_zci( @@ -414,7 +415,7 @@ ddg_goodie_test( structured_answer => { input => ['2,90 + sec(4,6)'], operation => 'Calculate', - result => qr/>-6,01642861135959 re(qr/>-6,01642861135959 test_zci( @@ -423,7 +424,7 @@ ddg_goodie_test( structured_answer => { input => ['100 - 96.54'], operation => 'Calculate', - result => qr/>3\.46 re(qr/>3\.46 test_zci( @@ -432,7 +433,7 @@ ddg_goodie_test( structured_answer => { input => ['1. + 1.'], operation => 'Calculate', - result => qr/>2 re(qr/>2 test_zci( @@ -441,7 +442,7 @@ ddg_goodie_test( structured_answer => { input => ['1 + sin(pi)'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -450,7 +451,7 @@ ddg_goodie_test( structured_answer => { input => ['1 - 1'], operation => 'Calculate', - result => qr/>0 re(qr/>0 test_zci( @@ -459,7 +460,7 @@ ddg_goodie_test( structured_answer => { input => ['sin(pi / 2)'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -468,7 +469,7 @@ ddg_goodie_test( structured_answer => { input => ['sin(pi)'], operation => 'Calculate', - result => qr/>0 re(qr/>0 test_zci( @@ -477,7 +478,7 @@ ddg_goodie_test( structured_answer => { input => ['cos(2 pi)'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -486,7 +487,7 @@ ddg_goodie_test( structured_answer => { input => ['5 ^ 2'], operation => 'Calculate', - result => qr/>25 re(qr/>25 test_zci( @@ -495,7 +496,7 @@ ddg_goodie_test( structured_answer => { input => ['sqrt(4)'], operation => 'Calculate', - result => qr/>2 re(qr/>2 test_zci( @@ -504,7 +505,7 @@ ddg_goodie_test( structured_answer => { input => ['1.0 + 5 ^ 2'], operation => 'Calculate', - result => qr/>26 re(qr/>26 test_zci( @@ -513,7 +514,7 @@ ddg_goodie_test( structured_answer => { input => ['3 ^ 2 + 4 ^ 2'], operation => 'Calculate', - result => qr/>25 re(qr/>25 test_zci( @@ -522,7 +523,7 @@ ddg_goodie_test( structured_answer => { input => ['2,2 ^ 2'], operation => 'Calculate', - result => qr/>4,84 re(qr/>4,84 test_zci( @@ -531,7 +532,7 @@ ddg_goodie_test( structured_answer => { input => ['0.8 ^ 2 + 0.6 ^ 2'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -540,7 +541,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 2 ^ 3'], operation => 'Calculate', - result => qr/>256 re(qr/>256 test_zci( @@ -549,7 +550,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 2 ^ 3.06'], operation => 'Calculate', - result => qr/>323\.972172143725 re(qr/>323\.972172143725 test_zci( @@ -558,7 +559,7 @@ ddg_goodie_test( structured_answer => { input => ['2 ^ 3 ^ 2'], operation => 'Calculate', - result => qr/>512 re(qr/>512 test_zci( @@ -567,7 +568,7 @@ ddg_goodie_test( structured_answer => { input => ['sqrt(2)'], operation => 'Calculate', - result => qr/>1\.4142135623731 re(qr/>1\.4142135623731 test_zci( @@ -576,7 +577,7 @@ ddg_goodie_test( structured_answer => { input => ['sqrt(3 pi / 4 + 1) + 1'], operation => 'Calculate', - result => qr/>2\.83199194599549 re(qr/>2\.83199194599549 test_zci( @@ -585,7 +586,7 @@ ddg_goodie_test( structured_answer => { input => ['4 score + 7'], operation => 'Calculate', - result => qr/>87 re(qr/>87 test_zci( @@ -594,7 +595,7 @@ ddg_goodie_test( structured_answer => { input => ['418.1 / 2'], operation => 'Calculate', - result => qr/>209\.05 re(qr/>209\.05 test_zci( @@ -603,7 +604,7 @@ ddg_goodie_test( structured_answer => { input => ['418.005 / 8'], operation => 'Calculate', - result => qr/>52\.250625 re(qr/>52\.250625 test_zci( @@ -612,7 +613,7 @@ ddg_goodie_test( structured_answer => { input => ['(pi ^ 4 + pi ^ 5) ^ (1 / 6)'], operation => 'Calculate', - result => qr/>2\.71828180861191 re(qr/>2\.71828180861191 test_zci( @@ -621,7 +622,7 @@ ddg_goodie_test( structured_answer => { input => ['(pi ^ 4 + pi ^ 5) ^ (1 / 6) + 1'], operation => 'Calculate', - result => qr/>3\.71828180861191 re(qr/>3\.71828180861191 test_zci( @@ -630,7 +631,7 @@ ddg_goodie_test( structured_answer => { input => ['5 ^ 4 ^ (3 - 2) ^ 1'], operation => 'Calculate', - result => qr/>625 re(qr/>625 test_zci( @@ -639,7 +640,7 @@ ddg_goodie_test( structured_answer => { input => ['(5 - 4) ^ (3 - 2) ^ 1'], operation => 'Calculate', - result => qr/>1 re(qr/>1 test_zci( @@ -648,7 +649,7 @@ ddg_goodie_test( structured_answer => { input => ['(5 + 4 - 3) ^ (2 - 1)'], operation => 'Calculate', - result => qr/>6 re(qr/>6 test_zci( @@ -657,7 +658,7 @@ ddg_goodie_test( structured_answer => { input => ['5 ^ ((4 - 3) * (2 + 1)) + 6'], operation => 'Calculate', - result => qr/>131 re(qr/>131 test_zci( @@ -666,7 +667,7 @@ ddg_goodie_test( structured_answer => { input => ['20 * 07'], operation => 'Calculate', - result => qr/>140 re(qr/>140 test_zci( @@ -675,7 +676,7 @@ ddg_goodie_test( structured_answer => { input => ['83.166.167.160 / 33'], operation => 'Calculate', - result => qr/>2\.520\.186\.883,63636 re(qr/>2\.520\.186\.883,63636 test_zci( @@ -684,7 +685,7 @@ ddg_goodie_test( structured_answer => { input => ['123.123.123.123 / 255.255.255.256'], operation => 'Calculate', - result => qr/>0,482352941174581 re(qr/>0,482352941174581 test_zci( @@ -693,7 +694,7 @@ ddg_goodie_test( structured_answer => { input => ['(4 * 10 ^ 5) + 1'], operation => 'Calculate', - result => qr/>400,001 re(qr/>400,001 test_zci( @@ -702,7 +703,7 @@ ddg_goodie_test( structured_answer => { input => ['(4 * 10 ^ 5) + 1'], operation => 'Calculate', - result => qr/>400,001 re(qr/>400,001 test_zci( @@ -711,7 +712,7 @@ ddg_goodie_test( structured_answer => { input => ['(3 * 10 ^- 2) * 9'], operation => 'Calculate', - result => qr/>0.27 re(qr/>0.27 test_zci( @@ -720,7 +721,7 @@ ddg_goodie_test( structured_answer => { input => ['(7 * 10 ^- 4) * 8'], operation => 'Calculate', - result => qr/>0.0056 re(qr/>0.0056 test_zci( @@ -729,7 +730,7 @@ ddg_goodie_test( structured_answer => { input => ['6 * (2 * 10 ^- 11)'], operation => 'Calculate', - result => qr/>1\.2 \* 10-10<\/sup> re(qr/>1\.2 \* 10-10<\/sup> test_zci( @@ -738,7 +739,7 @@ ddg_goodie_test( structured_answer => { input => ['7 + (7 * 10 ^- 7)'], operation => 'Calculate', - result => qr/>7.0000007 re(qr/>7.0000007 test_zci( @@ -747,7 +748,7 @@ ddg_goodie_test( structured_answer => { input => ['1 * 7 + e - 7'], operation => 'Calculate', - result => qr/>2.71828182845905 re(qr/>2.71828182845905 test_zci( @@ -756,7 +757,7 @@ ddg_goodie_test( structured_answer => { input => ['7 * e - 5'], operation => 'Calculate', - result => qr/>14.0279727992134 re(qr/>14.0279727992134 test_zci( @@ -765,7 +766,7 @@ ddg_goodie_test( structured_answer => { input => ['pi / (1 * 10 ^ 9)'], operation => 'Calculate', - result => qr/>3\.14159265358979 \* 10-9<\/sup> re(qr/>3\.14159265358979 \* 10-9<\/sup> test_zci( @@ -774,7 +775,7 @@ ddg_goodie_test( structured_answer => { input => ['pi * (1 * 10 ^ 9)'], operation => 'Calculate', - result => qr/>3,141,592,653\.58979 re(qr/>3,141,592,653\.58979 test_zci( @@ -783,7 +784,7 @@ ddg_goodie_test( structured_answer => { input => ['1234 + 5432'], operation => 'Calculate', - result => qr/6,666/ + result => re(qr/6,666/) } ), '1_234 + 5_432' => test_zci( @@ -792,7 +793,7 @@ ddg_goodie_test( structured_answer => { input => ['1234 + 5432'], operation => 'Calculate', - result => qr/6,666/ + result => re(qr/6,666/) } ), '(0.4e^(0))*cos(0)' => test_zci( @@ -801,7 +802,7 @@ ddg_goodie_test( structured_answer => { input => ['(0.4e ^ (0)) * cos(0)'], operation => 'Calculate', - result => qr'0.4' + result => re(qr'0.4') } ), '2pi' => test_zci( @@ -810,7 +811,7 @@ ddg_goodie_test( structured_answer => { input => ['2 pi'], operation => 'Calculate', - result => qr"6.28318530717958" + result => re(qr"6.28318530717958") } ), 'fact(3)' => test_zci( @@ -819,7 +820,7 @@ ddg_goodie_test( structured_answer => { input => ['fact(3)'], operation => 'Calculate', - result => qr/>6 re(qr/>6 test_zci( @@ -828,7 +829,7 @@ ddg_goodie_test( structured_answer => { input => ['fact(3)'], operation => 'Calculate', - result => qr/>6 re(qr/>6 undef, @@ -860,4 +861,4 @@ ddg_goodie_test( '(01780) 111 111' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CalendarConversion.t b/t/CalendarConversion.t index 059a0cdb2..84e840deb 100644 --- a/t/CalendarConversion.t +++ b/t/CalendarConversion.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'calendar_conversion'; @@ -48,4 +49,4 @@ ddg_goodie_test( '22nd Aug 2003 in gregorian time' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CalendarToday.t b/t/CalendarToday.t index 8fd3a0ab1..6c33fa98a 100755 --- a/t/CalendarToday.t +++ b/t/CalendarToday.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -14,9 +15,9 @@ ddg_goodie_test( DDG::Goodie::CalendarToday )], 'calendar' => test_zci( - qr/\nS M T W T F S[ ]+[A-Za-z]+ [0-9]{4}\n.+/, + re(qr/\nS M T W T F S[ ]+[A-Za-z]+ [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -27,9 +28,9 @@ ddg_goodie_test( } ), 'calendar november' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -40,9 +41,9 @@ ddg_goodie_test( } ), 'calendar november 12th' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -53,9 +54,9 @@ ddg_goodie_test( } ), 'calendar last november' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -66,9 +67,9 @@ ddg_goodie_test( } ), 'calendar next november' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -217,7 +218,7 @@ S M T W T F S November 2009 29 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -236,7 +237,7 @@ S M T W T F S November 2015 |29| 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -255,7 +256,7 @@ S M T W T F S November 2015 |29| 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -275,7 +276,7 @@ S M T W T F S November 1980 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -294,7 +295,7 @@ S M T W T F S November 2009 29 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -305,9 +306,9 @@ S M T W T F S November 2009 } ), 'next november on a calendar' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -318,9 +319,9 @@ S M T W T F S November 2009 } ), 'calendar for november' => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -339,7 +340,7 @@ S M T W T F S November 2009 29 30 ", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -351,9 +352,9 @@ S M T W T F S November 2009 ), '22/8/2003 to the hijri calendar' => undef, "today's calendar" => test_zci( - qr/\nS M T W T F S [A-Z][a-z]+ [0-9]{4}\n.+/, + re(qr/\nS M T W T F S [A-Z][a-z]+ [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -364,9 +365,9 @@ S M T W T F S November 2009 } ), "november's calendar" => test_zci( - qr/\nS M T W T F S November [0-9]{4}\n.+/, + re(qr/\nS M T W T F S November [0-9]{4}\n.+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -379,14 +380,14 @@ S M T W T F S November 2009 ); # Special focus on relative dates, examining the "today" circle -my $test_location_tz = qr/\(EDT, UTC-4\)/; +my $test_location_tz = re(qr/\(EDT, UTC-4\)/); set_fixed_time("2014-06-11T09:45:56"); ddg_goodie_test( [qw( DDG::Goodie::CalendarToday )], "calendar yesterday" => test_zci( - qr/June 2014.*\|10\|/s, + re(qr/June 2014.*\|10\|/s), structured_answer => { data => { month_year => "June 2014", @@ -445,7 +446,7 @@ ddg_goodie_test( } ), "calendar today" => test_zci( - qr/June 2014.*\|11\|/s, + re(qr/June 2014.*\|11\|/s), structured_answer => { data => { month_year => "June 2014", @@ -504,7 +505,7 @@ ddg_goodie_test( } ), "calendar tomorrow" => test_zci( - qr/June 2014.*\|12\|/s, + re(qr/June 2014.*\|12\|/s), structured_answer => { data => { month_year => "June 2014", @@ -563,7 +564,7 @@ ddg_goodie_test( } ), "calendar 20 days ago" => test_zci( - qr/May 2014.*\|22\|/s, + re(qr/May 2014.*\|22\|/s), structured_answer => { data => { month_year => "May 2014", @@ -627,7 +628,7 @@ ddg_goodie_test( } ), "calendar in 20 days" => test_zci( - qr/July 2014.*\| 1\|/s, + re(qr/July 2014.*\| 1\|/s), structured_answer => { data => { month_year => "July 2014", @@ -689,7 +690,7 @@ ddg_goodie_test( } ), "calendar last week" => test_zci( - qr/June 2014.*\| 4\|/s, + re(qr/June 2014.*\| 4\|/s), structured_answer => { data => { month_year => "June 2014", @@ -748,7 +749,7 @@ ddg_goodie_test( } ), "calendar next week" => - test_zci(qr/June 2014.*\|18\|/s, + test_zci(re(qr/June 2014.*\|18\|/s), structured_answer => { data => { month_year => "June 2014", @@ -807,7 +808,7 @@ ddg_goodie_test( } ), "calendar last year" => - test_zci(qr/June 2013.*\|11\|/s, + test_zci(re(qr/June 2013.*\|11\|/s), structured_answer => { data => { month_year => "June 2013", @@ -874,7 +875,7 @@ ddg_goodie_test( } ), "calendar next year" => - test_zci(qr/June 2015.*\|11\|/s, + test_zci(re(qr/June 2015.*\|11\|/s), structured_answer => { data => { month_year => "June 2015", @@ -937,4 +938,3 @@ ddg_goodie_test( restore_time(); done_testing; - diff --git a/t/CallingCodes.t b/t/CallingCodes.t index eff0e6b86..f1df2bf93 100644 --- a/t/CallingCodes.t +++ b/t/CallingCodes.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "calling_codes"; @@ -93,4 +94,4 @@ ddg_goodie_test( "calling code 599" => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CamelCase.t b/t/CamelCase.t index ebff437f1..adb7a5230 100644 --- a/t/CamelCase.t +++ b/t/CamelCase.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "camel_case"; @@ -44,4 +45,4 @@ ddg_goodie_test( 'camelcase this' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Chars.t b/t/Chars.t index 8ec7f022c..10f977bd5 100644 --- a/t/Chars.t +++ b/t/Chars.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'chars'; @@ -103,4 +104,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Chess960.t b/t/Chess960.t index 8831bf2eb..d8f26bae3 100644 --- a/t/Chess960.t +++ b/t/Chess960.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'chess960_position'; @@ -15,7 +16,7 @@ ddg_goodie_test( 'chess960 random' => test_zci( 'Chess 960', structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => "text", item => 0, @@ -28,4 +29,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/ChineseZodiac.t b/t/ChineseZodiac.t index 39b2f3f95..e1d71f598 100644 --- a/t/ChineseZodiac.t +++ b/t/ChineseZodiac.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::MockTime qw( :all ); use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -132,4 +133,3 @@ ddg_goodie_test( restore_time(); done_testing; - diff --git a/t/CoffeeToWaterRatio.t b/t/CoffeeToWaterRatio.t index 575717f22..fa429874e 100644 --- a/t/CoffeeToWaterRatio.t +++ b/t/CoffeeToWaterRatio.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "coffee_to_water_ratio"; @@ -79,4 +80,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Coin.t b/t/Coin.t index 7c64ed250..ffc23504d 100644 --- a/t/Coin.t +++ b/t/Coin.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'coin'; @@ -11,85 +12,85 @@ zci is_cached => 0; ddg_goodie_test( [qw( DDG::Goodie::Coin )], 'flip a coin' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'flip coin' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'flip 1 coin' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'flip 2 coins' => test_zci( - qr/(heads|tails), (heads|tails) \(random\)/, + re(qr/(heads|tails), (heads|tails) \(random\)/), structured_answer => { input => [2], operation => 'Flip coin', - result => qr/(heads|tails), / + result => re(qr/(heads|tails), /) } ), 'toss a coin' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'toss 1 coin' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'toss 2 coins' => test_zci( - qr/(heads|tails), (heads|tails) \(random\)/, + re(qr/(heads|tails), (heads|tails) \(random\)/), structured_answer => { input => [2], operation => 'Flip coin', - result => qr/(heads|tails), / + result => re(qr/(heads|tails), /) } ), 'heads or tails' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'heads or tails?' => test_zci( - qr/(heads|tails) \(random\)/, + re(qr/(heads|tails) \(random\)/), structured_answer => { input => [1], operation => 'Flip coin', - result => qr/^(heads|tails)$/ + result => re(qr/^(heads|tails)$/) } ), 'flip 4 coins' => test_zci( - qr/((heads|tails),? ){4}\(random\)/, + re(qr/((heads|tails),? ){4}\(random\)/), structured_answer => { input => [4], operation => 'Flip coin', - result => qr/(heads|tails),? / + result => re(qr/(heads|tails),? /) } ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ColorCodes.t b/t/ColorCodes.t index da241cc03..613aea0e9 100755 --- a/t/ColorCodes.t +++ b/t/ColorCodes.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'color_code'; @@ -13,7 +14,7 @@ my $green_answer = 'Hex: #00FF00 ~ RGBA(0, 255, 0, 1) ~ RGB(0%, 100%, 0%) ~ HSL( my %basic_answer = ( structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, diff --git a/t/Combination.t b/t/Combination.t index 6c3a2a711..e1ad450b5 100755 --- a/t/Combination.t +++ b/t/Combination.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "combination"; @@ -38,4 +39,4 @@ ddg_goodie_test( '1000000000000 choose 2000' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Constants.t b/t/Constants.t index c2a743637..fae5315e8 100644 --- a/t/Constants.t +++ b/t/Constants.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "constants"; @@ -54,4 +55,4 @@ ddg_goodie_test( "why?" => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Conversions.t b/t/Conversions.t index 67afa60b5..6cac584f1 100755 --- a/t/Conversions.t +++ b/t/Conversions.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; zci answer_type => 'conversions'; @@ -2815,4 +2816,4 @@ ddg_goodie_test( '1E300 miles in metres' => undef, '5 pas.i to atm' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ConvertLatLon.t b/t/ConvertLatLon.t index 2f308600d..9cf973e6b 100644 --- a/t/ConvertLatLon.t +++ b/t/ConvertLatLon.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -102,14 +103,14 @@ ddg_goodie_test( 'convert 39.75 degrees to farenheit' => undef, #Check for to-format name - '16.5° S, 68.15° W dms' => test_zci(qr/./, + '16.5° S, 68.15° W dms' => test_zci(re(qr/./), structured_answer => { input => ["16.5° S", "68.15° W"], operation => "Convert to DMS", result => "16° 30′ S, 68° 9′ W", } ), - '16° 30′ S, 68° 9′ W decimal' => test_zci(qr/./, + '16° 30′ S, 68° 9′ W decimal' => test_zci(re(qr/./), structured_answer => { input => ["16° 30′ S", "68° 9′ W"], operation => "Convert to decimal", @@ -119,4 +120,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/CountryCodes.t b/t/CountryCodes.t index d283c8617..f2708625f 100644 --- a/t/CountryCodes.t +++ b/t/CountryCodes.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "country_codes"; @@ -44,4 +45,4 @@ ddg_goodie_test( 'iso code for english' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/CryptHashCheck.t b/t/CryptHashCheck.t index b0e5ff548..76b6747d0 100644 --- a/t/CryptHashCheck.t +++ b/t/CryptHashCheck.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'crypthashcheck'; @@ -171,4 +172,3 @@ ddg_goodie_test( done_testing; - diff --git a/t/CurrencyIn.t b/t/CurrencyIn.t index 5034b5f63..8509db17f 100644 --- a/t/CurrencyIn.t +++ b/t/CurrencyIn.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'currency_in'; @@ -84,4 +85,4 @@ ddg_goodie_test( ) ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Cusip.t b/t/Cusip.t index 440562c68..a9687f580 100644 --- a/t/Cusip.t +++ b/t/Cusip.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "cusip"; @@ -56,7 +57,7 @@ ddg_goodie_test( ), 'cusip check 037833100' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -64,7 +65,7 @@ ddg_goodie_test( ), 'cusip 844741108' => test_zci("844741108 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -72,7 +73,7 @@ ddg_goodie_test( ), '037833100 cusip' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -80,7 +81,7 @@ ddg_goodie_test( ), '037833100 cusip check' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -90,7 +91,7 @@ ddg_goodie_test( # starting white space should be stripped 'cusip 037833100' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -100,7 +101,7 @@ ddg_goodie_test( # ending white space should be stripped 'cusip 037833100 ' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -110,7 +111,7 @@ ddg_goodie_test( # starting and ending white space should be stripped 'cusip 037833100 ' => test_zci("037833100 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -120,7 +121,7 @@ ddg_goodie_test( # same AAPL queries with an incorrect check digit 'cusip 03783310A' => test_zci("03783310A is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -128,7 +129,7 @@ ddg_goodie_test( ), 'cusip 03783310A' => test_zci("03783310A is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -136,7 +137,7 @@ ddg_goodie_test( ), 'cusip 03783310A ' => test_zci("03783310A is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -144,7 +145,7 @@ ddg_goodie_test( ), 'cusip 03783310A ' => test_zci("03783310A is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -154,7 +155,7 @@ ddg_goodie_test( # check CUSIP IDs with capital letters (these are for GOOG and Blackberry) 'cusip 38259P706' => test_zci("38259P706 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -162,7 +163,7 @@ ddg_goodie_test( ), 'cusip 38259P508' => test_zci("38259P508 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -170,7 +171,7 @@ ddg_goodie_test( ), 'cusip 09228F103' => test_zci("09228F103 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -180,7 +181,7 @@ ddg_goodie_test( # check the same CUSIP IDs with lower case letters 'cusip 38259p706' => test_zci("38259P706 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -188,7 +189,7 @@ ddg_goodie_test( ), 'cusip 38259p508' => test_zci("38259P508 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -196,7 +197,7 @@ ddg_goodie_test( ), 'cusip 09228f103' => test_zci("09228F103 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -208,7 +209,7 @@ ddg_goodie_test( # if possible, these tests should be replaced with verified CUSIP IDs 'cusip 037833*00' => test_zci("037833*00 is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -216,7 +217,7 @@ ddg_goodie_test( ), 'cusip 037833*02' => test_zci("037833*02 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -224,7 +225,7 @@ ddg_goodie_test( ), 'cusip 0378331#0' => test_zci("0378331#0 is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -232,7 +233,7 @@ ddg_goodie_test( ), 'cusip 0378331#7' => test_zci("0378331#7 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -240,7 +241,7 @@ ddg_goodie_test( ), 'cusip 037833@00' => test_zci("037833\@00 is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -248,7 +249,7 @@ ddg_goodie_test( ), 'cusip 037833@01' => test_zci("037833\@01 is a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -259,7 +260,7 @@ ddg_goodie_test( # even though they are always invalid IDs 'cusip 03783310*' => test_zci("03783310* is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -267,7 +268,7 @@ ddg_goodie_test( ), 'cusip 03783310#' => test_zci("03783310# is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -275,7 +276,7 @@ ddg_goodie_test( ), 'cusip 03783310@' => test_zci("03783310\@ is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -285,7 +286,7 @@ ddg_goodie_test( # Odd CUSIP IDs should not break the IA 'cusip ********8' => test_zci("********8 is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -293,7 +294,7 @@ ddg_goodie_test( ), 'cusip ########9' => test_zci("########9 is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -301,7 +302,7 @@ ddg_goodie_test( ), 'cusip @#*@#*@#*' => test_zci("\@#*\@#*\@#* is not a properly formatted CUSIP number.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', } @@ -310,4 +311,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/DHL.t b/t/DHL.t index a6b24e6a8..6ce5c32ef 100644 --- a/t/DHL.t +++ b/t/DHL.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'dhl'; @@ -28,4 +29,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/DateMath.t b/t/DateMath.t index 061556d84..88b75d3e8 100755 --- a/t/DateMath.t +++ b/t/DateMath.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use Test::MockTime qw( :all ); use DDG::Test::Goodie; use DDG::Test::Location; @@ -125,4 +126,4 @@ location_test([ qw( DDG::Goodie::DateMath ) ], 'time ago' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/DayOfWeek.t b/t/DayOfWeek.t index dbd96b2c9..c2e292529 100644 --- a/t/DayOfWeek.t +++ b/t/DayOfWeek.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -70,4 +71,4 @@ ddg_goodie_test( restore_time(); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/DaysBetween.t b/t/DaysBetween.t index b6c95a8f9..454e626f2 100755 --- a/t/DaysBetween.t +++ b/t/DaysBetween.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -76,57 +77,57 @@ ddg_goodie_test( }, ), 'days between jan 1 and jan 15 inclusive' => test_zci( - qr/^There are 15 days between.+inclusive\.$/, + re(qr/^There are 15 days between.+inclusive\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between, inclusive', result => 15 }, ), 'days between jan 1 and 15th feb' => test_zci( - qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/, + re(qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 45 }, ), 'number of days between jan 1 and 15th feb' => test_zci( - qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/, + re(qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 45 }, ), 'number of days from jan 1 and 15th feb' => test_zci( - qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/, + re(qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 45 }, ), 'days from jan 1 and 15th feb' => test_zci( - qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/, + re(qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 45 }, ), 'days between today and tomorrow' => test_zci( - qr/^There are 1 days between.+ and.+\.$/, + re(qr/^There are 1 days between.+ and.+\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 1 }, ), 'how many days between feb 2 and feb 17' => test_zci( - qr/^There are 15 days between.+ and.+\.$/, + re(qr/^There are 15 days between.+ and.+\.$/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Days between', result => 15 }, @@ -149,4 +150,4 @@ ddg_goodie_test( ); restore_time(); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Dessert.t b/t/Dessert.t index 3c0dd720d..94b14b270 100644 --- a/t/Dessert.t +++ b/t/Dessert.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'dessert'; @@ -13,81 +14,81 @@ ddg_goodie_test( 'DDG::Goodie::Dessert' ], 'desserts beginning with a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'desserts beginning with A' => test_zci( - qr/(.*?) is a dessert that begins with 'A'\.$/, + re(qr/(.*?) is a dessert that begins with 'A'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'dessert start with a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'desserts starting with a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'dessert starts with a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'desserts beginning with z' => test_zci( - qr/(.*?) is a dessert that begins with 'z'\.$/, + re(qr/(.*?) is a dessert that begins with 'z'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'a dessert that begins with a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'a dessert that starts with the letter a' => test_zci( - qr/(.*?) is a dessert that begins with 'a'\.$/, + re(qr/(.*?) is a dessert that begins with 'a'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } } ), 'dessert that begins with the letter z' => test_zci( - qr/(.*?) is a dessert that begins with 'z'\.$/, + re(qr/(.*?) is a dessert that begins with 'z'\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'info', } @@ -95,4 +96,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Dewey.t b/t/Dewey.t index f86e88eda..1fcb7050a 100644 --- a/t/Dewey.t +++ b/t/Dewey.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'dewey_decimal'; @@ -21,4 +22,4 @@ ddg_goodie_test( 'dewey 644' => test_zci('644 is household utilities in the Dewey Decimal System.', html => '644 is household utilities in the Dewey Decimal System.'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Dice.t b/t/Dice.t index c08259297..dee3abfc3 100644 --- a/t/Dice.t +++ b/t/Dice.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'dice_roll'; @@ -17,9 +18,9 @@ ddg_goodie_test( # Check trigger kicks in. 'throw dice' => test_zci( - qr/^., .$/, + re(qr/^., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -29,9 +30,9 @@ ddg_goodie_test( } ), 'throw dices' => test_zci( - qr/^., .$/, + re(qr/^., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -41,9 +42,9 @@ ddg_goodie_test( } ), 'roll dice' => test_zci( - qr/^., .$/, + re(qr/^., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -53,9 +54,9 @@ ddg_goodie_test( } ), 'throw die' => test_zci( - qr/^.$/, + re(qr/^.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -68,9 +69,9 @@ ddg_goodie_test( # Simple "dice" query "roll 5 dice" => test_zci( - qr/., ., ., ., .$/, + re(qr/., ., ., ., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -82,9 +83,9 @@ ddg_goodie_test( # Simple shorthand query "roll 2d6" => test_zci( - qr/^\d (\+|-) \d$/, + re(qr/^\d (\+|-) \d$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -96,9 +97,9 @@ ddg_goodie_test( # Query with numbers as words "roll five dice" => test_zci( - qr/., ., ., ., .$/, + re(qr/., ., ., ., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -108,9 +109,9 @@ ddg_goodie_test( } ), "roll twenty five dice" => test_zci( - qr/., ., ., ., .$/, + re(qr/., ., ., ., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -120,9 +121,9 @@ ddg_goodie_test( } ), "roll fifty-four dice" => test_zci( - qr/., ., ., ., .$/, + re(qr/., ., ., ., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -132,9 +133,9 @@ ddg_goodie_test( } ), "roll seven dices" => test_zci( - qr/., ., ., ., .$/, + re(qr/., ., ., ., .$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -147,9 +148,9 @@ ddg_goodie_test( "roll foo dice" => undef, "throw 1d20" => test_zci( - qr/^\d{1,2}$/, + re(qr/^\d{1,2}$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -159,9 +160,9 @@ ddg_goodie_test( } ), "roll d20" => test_zci( - qr/^\d{1,2}$/, + re(qr/^\d{1,2}$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -173,9 +174,9 @@ ddg_goodie_test( # Simple shorthand queries with +- "roll 3d12 + 4" => test_zci( - qr/^\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2}$/, + re(qr/^\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2}$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -185,9 +186,9 @@ ddg_goodie_test( } ), "roll 3d8 - 8" => test_zci( - qr/^\d (\+|-) \d (\+|-) \d (\+|-) \d$/, + re(qr/^\d (\+|-) \d (\+|-) \d (\+|-) \d$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -197,9 +198,9 @@ ddg_goodie_test( } ), "roll 4d6-l" => test_zci( - qr/^([1-6] \+ ){3}[1-6] - [1-6]$/, + re(qr/^([1-6] \+ ){3}[1-6] - [1-6]$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -211,9 +212,9 @@ ddg_goodie_test( # Simple conjunctive "dice" query "throw 2 dice and 3 dice" => test_zci( - qr/., .., ., .Total: \d+$/, + re(qr/., .., ., .Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -225,9 +226,9 @@ ddg_goodie_test( # Shorthand conjunctive query "roll 2w6 and d20" => test_zci( - qr/^\d (\+|-) \d = \d+\d+Total: \d+$/, + re(qr/^\d (\+|-) \d = \d+\d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -239,9 +240,9 @@ ddg_goodie_test( # Shorthand conjunctive queries with +- "roll 2d6 and 3d12 + 4" => test_zci( - qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/, + re(qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -251,9 +252,9 @@ ddg_goodie_test( } ), "roll 2d6 and 3d12 - 4" => test_zci( - qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = -?\d+Total: \d+$/, + re(qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = -?\d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -263,9 +264,9 @@ ddg_goodie_test( } ), "throw 3d12 - 4 and 2d6" => test_zci( - qr/^\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = -?\d{1,2}\d (\+|-) \d = \d+Total: \d+$/, + re(qr/^\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = -?\d{1,2}\d (\+|-) \d = \d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -275,9 +276,9 @@ ddg_goodie_test( } ), "throw 2d6 and 3d12 + 4" => test_zci( - qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/, + re(qr/^\d (\+|-) \d = \d+\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -287,9 +288,9 @@ ddg_goodie_test( } ), "roll 2d6 and 4w6-l" => test_zci( - qr/^\d (\+|-) \d = \d+([1-6] \+ ){3}[1-6] - [1-6] = \d{1,2}Total: \d+$/, + re(qr/^\d (\+|-) \d = \d+([1-6] \+ ){3}[1-6] - [1-6] = \d{1,2}Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -299,9 +300,9 @@ ddg_goodie_test( } ), "roll 2 dice and 3d5 + 4" => test_zci( - qr/^., .\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/, + re(qr/^., .\d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} (\+|-) \d{1,2} = \d+Total: \d+$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -325,9 +326,9 @@ ddg_goodie_test( "roll 2d3 and 2d4-a" => undef, "throw die" => test_zci( - qr/^.$/, + re(qr/^.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -338,9 +339,9 @@ ddg_goodie_test( ), 'roll 3d12' => test_zci( - qr/\d{1,2} \+ \d{1,2} \+ \d{1,2}/, + re(qr/\d{1,2} \+ \d{1,2} \+ \d{1,2}/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', options => { @@ -350,9 +351,9 @@ ddg_goodie_test( } ), 'roll 3d12 and 2d4' => test_zci( - qr/\d{1,2} \+ \d{1,2} \+ \d{1,2} = \d+[1-4]+ \+ [1-4]+ = \dTotal: \d+/, + re(qr/\d{1,2} \+ \d{1,2} \+ \d{1,2} = \d+[1-4]+ \+ [1-4]+ = \dTotal: \d+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -362,9 +363,9 @@ ddg_goodie_test( } ), 'roll 2 dice and 3d5' => test_zci( - qr/[1-5]+ \+ [1-5]+ \+ [1-5]+ = \d+Total: \d+/, + re(qr/[1-5]+ \+ [1-5]+ \+ [1-5]+ = \d+Total: \d+/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -375,4 +376,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/DuckDuckGo.t b/t/DuckDuckGo.t index 24937e376..03ba8dd74 100644 --- a/t/DuckDuckGo.t +++ b/t/DuckDuckGo.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'duckduckgo'; @@ -174,4 +175,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/EmToPx.t b/t/EmToPx.t index eeffc5b0b..4032ab02b 100644 --- a/t/EmToPx.t +++ b/t/EmToPx.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'conversion'; @@ -41,4 +42,4 @@ ddg_goodie_test( '11px to em at base-pixel size 23px' => build_test('0.478em', '11', 'px', '23'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/EmailValidator.t b/t/EmailValidator.t index 814e7bed1..356c1d48e 100644 --- a/t/EmailValidator.t +++ b/t/EmailValidator.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'email_validation'; @@ -11,63 +12,63 @@ zci is_cached => 1; ddg_goodie_test( ['DDG::Goodie::EmailValidator'], 'validate my email foo@example.com' => test_zci( - qr/appears to be valid/, + re(qr/appears to be valid/), structured_answer => { input => ['foo@example.com'], operation => 'Email address validation', - result => qr/appears to be valid/ + result => re(qr/appears to be valid/) } ), 'validate my email foo+abc@example.com' => test_zci( - qr/appears to be valid/, + re(qr/appears to be valid/), structured_answer => { input => ['foo+abc@example.com'], operation => 'Email address validation', - result => qr/appears to be valid/ + result => re(qr/appears to be valid/) } ), 'validate my email foo.bar@example.com' => test_zci( - qr/appears to be valid/, + re(qr/appears to be valid/), structured_answer => { input => ['foo.bar@example.com'], operation => 'Email address validation', - result => qr/appears to be valid/ + result => re(qr/appears to be valid/) } ), 'validate user@exampleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' => test_zci( - qr/Please check the address/, + re(qr/Please check the address/), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Email address validation', - result => qr/Please check the address/, + result => re(qr/Please check the address/), } ), 'validate foo@example.com' => test_zci( - qr/appears to be valid/, + re(qr/appears to be valid/), structured_answer => { input => ['foo@example.com'], operation => 'Email address validation', - result => qr/appears to be valid/ + result => re(qr/appears to be valid/) } ), 'validate foo@!!!.com' => test_zci( - qr/Please check the fully qualified domain name/, + re(qr/Please check the fully qualified domain name/), structured_answer => { input => ['foo@!!!.com'], operation => 'Email address validation', - result => qr/Please check the fully qualified domain name/, + result => re(qr/Please check the fully qualified domain name/), } ), 'validate foo@example.lmnop' => test_zci( - qr/Please check the top-level domain/, + re(qr/Please check the top-level domain/), structured_answer => { input => ['foo@example.lmnop'], operation => 'Email address validation', - result => qr/Please check the top-level domain/, + result => re(qr/Please check the top-level domain/), } ), 'validate foo' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FIGlet.t b/t/FIGlet.t index 9969bc75e..edb5d6ee2 100644 --- a/t/FIGlet.t +++ b/t/FIGlet.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'figlet'; @@ -205,4 +206,4 @@ ddg_goodie_test( 'big text' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Factors.t b/t/Factors.t index 6d51457b0..99b375180 100755 --- a/t/Factors.t +++ b/t/Factors.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "factors"; @@ -30,4 +31,4 @@ ddg_goodie_test( '72 factors' => build_test('Factors of 72: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72', '72', '1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FedEx.t b/t/FedEx.t index bf55ceef7..084d707ad 100644 --- a/t/FedEx.t +++ b/t/FedEx.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'fedex'; @@ -33,4 +34,4 @@ ddg_goodie_test( ) ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FenViewer.t b/t/FenViewer.t index 409ac0716..9564d77b8 100644 --- a/t/FenViewer.t +++ b/t/FenViewer.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "fen_viewer"; @@ -20,4 +21,4 @@ ddg_goodie_test( 'fen ' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Fibonacci.t b/t/Fibonacci.t index d20894bb4..9c2ef1df4 100644 --- a/t/Fibonacci.t +++ b/t/Fibonacci.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'fibonacci'; @@ -30,4 +31,4 @@ ddg_goodie_test( 'what are fibonacci numbers?' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FirefoxOS.t b/t/FirefoxOS.t index 3f33b7c3b..78f52c599 100644 --- a/t/FirefoxOS.t +++ b/t/FirefoxOS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "firefoxos"; @@ -10,7 +11,7 @@ zci is_cached => 1; #Structured answer template data my $templateData = { - data => '-ANY-', + data => ignore(), meta => { sourceName => "Mozilla Developer Network", sourceUrl => "https://developer.mozilla.org/en-US/Apps/Reference/Firefox_OS_device_APIs" @@ -39,4 +40,4 @@ ddg_goodie_test( 'firefox os api' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FlipText.t b/t/FlipText.t index b072035aa..9f2eb296c 100644 --- a/t/FlipText.t +++ b/t/FlipText.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'flip_text'; @@ -38,4 +39,4 @@ ddg_goodie_test( 'spin text <<"hello\' % & * () = + . #@!^(/world">>' => build_test('<<"hello\' % & * () = + . #@!^(/world">>','<<„pʃɹoʍ/)∨¡@# ˙ + = () ⁎ ⅋ % ,oʃʃǝɥ„>>'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Fortune.t b/t/Fortune.t index 07ccd8613..11c3a6c06 100755 --- a/t/Fortune.t +++ b/t/Fortune.t @@ -34,4 +34,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Frequency.t b/t/Frequency.t index 7b2e74462..c290115da 100644 --- a/t/Frequency.t +++ b/t/Frequency.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci is_cached => 1; @@ -26,4 +27,4 @@ ddg_goodie_test( 'frequency of B in battle' => test_zci('Frequency: b:1/6'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/FrequencySpectrum.t b/t/FrequencySpectrum.t index 0ad605e6f..a7ca29c7e 100644 --- a/t/FrequencySpectrum.t +++ b/t/FrequencySpectrum.t @@ -8,6 +8,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'frequency_spectrum'; @@ -18,10 +19,10 @@ ddg_goodie_test( #Primary example '50 hz' => test_zci( - #qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/, - qr/radio/, + #re(qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/), + re(qr/radio/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -34,9 +35,9 @@ ddg_goodie_test( #Secondary example '400 thz' => test_zci( - qr/infrared/, + re(qr/infrared/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -49,10 +50,10 @@ ddg_goodie_test( #Misc '1,000 hz' => test_zci( - #qr/radio.+audible.+human.+voice.+viola.+violin.+guitar.+mandolin.+banjo.+piano.+saxophone.+flute.+clarinet.+oboe/, - qr/radio/, + #re(qr/radio.+audible.+human.+voice.+viola.+violin.+guitar.+mandolin.+banjo.+piano.+saxophone.+flute.+clarinet.+oboe/), + re(qr/radio/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -63,9 +64,9 @@ ddg_goodie_test( } ), '1000000.99 hz' => test_zci( - qr/radio.+MF/, + re(qr/radio.+MF/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -76,9 +77,9 @@ ddg_goodie_test( } ), '29.1 hz' => test_zci( - qr/radio.+ELF/, + re(qr/radio.+ELF/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -91,10 +92,10 @@ ddg_goodie_test( #No whitespace between number and unit '50hz' => test_zci( - #qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/, - qr/radio/, + #re(qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/), + re(qr/radio/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -105,9 +106,9 @@ ddg_goodie_test( } ), '400terahertz' => test_zci( - qr/infrared/, + re(qr/infrared/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -120,9 +121,9 @@ ddg_goodie_test( #Mixed case '400 THz' => test_zci( - qr/infrared/, + re(qr/infrared/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -134,10 +135,10 @@ ddg_goodie_test( ), '1000 HZ' => test_zci( - #qr/radio.+audible.+human.+voice.+viola.+violin.+guitar.+mandolin.+banjo.+piano.+saxophone.+flute.+clarinet.+oboe/, - qr/radio/, + #re(qr/radio.+audible.+human.+voice.+viola.+violin.+guitar.+mandolin.+banjo.+piano.+saxophone.+flute.+clarinet.+oboe/), + re(qr/radio/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -150,9 +151,9 @@ ddg_goodie_test( #Commas in number '1,000,000.99 hz' => test_zci( - qr/radio.+MF/, + re(qr/radio.+MF/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -165,9 +166,9 @@ ddg_goodie_test( #Can you test with all the colours of the wind? '650 nm' => test_zci( - qr/visible.+red/, + re(qr/visible.+red/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -178,9 +179,9 @@ ddg_goodie_test( } ), '610 nanometers' => test_zci( - qr/visible.+orange/, + re(qr/visible.+orange/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -191,9 +192,9 @@ ddg_goodie_test( } ), '580 nanometres' => test_zci( - qr/visible.+yellow/, + re(qr/visible.+yellow/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -204,9 +205,9 @@ ddg_goodie_test( } ), '536 nanometer' => test_zci( - qr/visible.+green/, + re(qr/visible.+green/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -217,9 +218,9 @@ ddg_goodie_test( } ), '478.1 nm' => test_zci( - qr/visible.+blue/, + re(qr/visible.+blue/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -230,9 +231,9 @@ ddg_goodie_test( } ), '380.000000000 nanometres' => test_zci( - qr/visible.+violet/, + re(qr/visible.+violet/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -258,4 +259,4 @@ ddg_goodie_test( '600 nmeters' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GUID.t b/t/GUID.t index 2d3305887..e524ea9c1 100644 --- a/t/GUID.t +++ b/t/GUID.t @@ -3,12 +3,13 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'guid'; zci is_cached => 0; -my @answer = (qr/^([a-zA-Z]|\d){8}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){12}$/, structured_answer => { input =>[], operation => 'Random GUID', result =>qr/^([a-zA-Z]|\d){8}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){12}$/}); +my @answer = (re(qr/^([a-zA-Z]|\d){8}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){12}$/), structured_answer => { input =>[], operation => 'Random GUID', result =>re(qr/^([a-zA-Z]|\d){8}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){4}-([a-zA-Z]|\d){12}$/)}); ddg_goodie_test([qw( DDG::Goodie::GUID ) ], @@ -25,4 +26,4 @@ ddg_goodie_test([qw( DDG::Goodie::GUID ) ], 'what is a guid' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Game2048.t b/t/Game2048.t index 0c5cc0acd..b3bc9e359 100644 --- a/t/Game2048.t +++ b/t/Game2048.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 2048; @@ -16,7 +17,7 @@ ddg_goodie_test( 'Play 2048', structured_answer => { - data => '-ANY-', + data => ignore(), # data => [{ # dimension => 4, @@ -35,7 +36,7 @@ ddg_goodie_test( 'Play 256', structured_answer => { - data => '-ANY-', + data => ignore(), # data => [{ # dimension => 7, @@ -53,4 +54,4 @@ ddg_goodie_test( '2048 online' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GenerateMAC.t b/t/GenerateMAC.t index 17c42c159..7c7c3f6ad 100755 --- a/t/GenerateMAC.t +++ b/t/GenerateMAC.t @@ -35,4 +35,4 @@ ddg_goodie_test( 'please generate mac address' => build_test(), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GibberishGenerator.t b/t/GibberishGenerator.t index 6bef76272..d1e618cfe 100644 --- a/t/GibberishGenerator.t +++ b/t/GibberishGenerator.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -9,8 +10,8 @@ zci is_cached => 0; sub build_result { my $result = shift; - return $result, structured_answer => { - data => "-ANY-", + return re($result), structured_answer => { + data => ignore(), templates => { group => 'info', options => { @@ -75,4 +76,4 @@ ddg_goodie_test( '30 words of utter Shakespearean nonsense' => build_test(werds($shake_word, 30)), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GoldenRatio.t b/t/GoldenRatio.t index aa7835357..b44103044 100644 --- a/t/GoldenRatio.t +++ b/t/GoldenRatio.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'golden_ratio'; @@ -29,4 +30,4 @@ ddg_goodie_test( 'golden ratio ?:123.345' => test_zci('Golden ratio: 76.2314023423558 : 123.345'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GreatestCommonFactor.t b/t/GreatestCommonFactor.t index 22c726c27..836b0d9f2 100644 --- a/t/GreatestCommonFactor.t +++ b/t/GreatestCommonFactor.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "greatest_common_factor"; @@ -46,4 +47,4 @@ ddg_goodie_test( 'gcd 0 0' => build_test('0 and 0', 0), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/GuitarChords.t b/t/GuitarChords.t index bfcf508aa..4dcc6e5ad 100644 --- a/t/GuitarChords.t +++ b/t/GuitarChords.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'guitarchord'; @@ -14,32 +15,32 @@ ddg_goodie_test( 'G#m6 guitar chord' => test_zci( 'G#m6', heading=>'G#m6', - html => qr#.*Guitar chord diagram for G\#m6.*#s + html => re(qr#.*Guitar chord diagram for G\#m6.*#s) ), 'Abaug7 guitar chord' => test_zci( 'Abaug7', heading=>'Abaug7', - html => qr#.*Guitar chord diagram for Abaug7.*#s + html => re(qr#.*Guitar chord diagram for Abaug7.*#s) ), 'A7/b9 guitar chord' => test_zci( 'A7(b9)', heading=>'A7(b9)', - html => qr#.*Guitar chord diagram for A7\(b9\).*#s + html => re(qr#.*Guitar chord diagram for A7\(b9\).*#s) ), 'guitar chord Cm7' => test_zci( 'Cm7', heading=>'Cm7', - html => qr#.*Guitar chord diagram for Cm7.*#s + html => re(qr#.*Guitar chord diagram for Cm7.*#s) ), 'guitar chord Db7sus4' => test_zci( 'Db7sus4', heading=>'Db7sus4', - html => qr#.*Guitar chord diagram for Db7sus4.*#s + html => re(qr#.*Guitar chord diagram for Db7sus4.*#s) ), 'guitar chord f min' => test_zci( 'Fm', heading=>'Fm', - html => qr#.*Guitar chord diagram for Fm.*#s + html => re(qr#.*Guitar chord diagram for Fm.*#s) ), # check that certain things don't trigger it: 'C# programming' => undef, @@ -50,4 +51,4 @@ ddg_goodie_test( 'G' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/HKDK.t b/t/HKDK.t index 0c73e99f5..0b59b18fa 100644 --- a/t/HKDK.t +++ b/t/HKDK.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'hkdk'; @@ -23,4 +24,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/HTMLEntitiesDecode.t b/t/HTMLEntitiesDecode.t index 681016276..d45f76797 100755 --- a/t/HTMLEntitiesDecode.t +++ b/t/HTMLEntitiesDecode.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'html_entity'; @@ -10,8 +11,8 @@ zci is_cached => 1; sub any_structured_answer { return { - input => '-ANY-', - result => '-ANY-', + input => ignore(), + result => ignore(), operation => "HTML Entity Decode" }; } @@ -36,9 +37,9 @@ ddg_goodie_test( 'htmlentity for #x3c' => test_zci("Decoded HTML Entity: <", structured_answer => any_structured_answer()), # "¢" succeeds - 'html decode ¢' => test_zci(qr/.*/, structured_answer => any_structured_answer()), + 'html decode ¢' => test_zci(re(qr/.*/), structured_answer => any_structured_answer()), # "¢" also succeeds (missing back ";" is OK) - 'html decode ¢' => test_zci(qr/.*/, structured_answer => any_structured_answer()), + 'html decode ¢' => test_zci(re(qr/.*/), structured_answer => any_structured_answer()), # "cent" fails during the regex match because of the missing front "&" (stricter for text to eliminate false positive encoding hits) 'html decode cent' => undef, # "cent;" fails during the regex match for the same reasons as above @@ -55,11 +56,11 @@ ddg_goodie_test( 'html decode apostrophe' => undef, # natural querying - 'What is the decoded html entity for π?' => test_zci(qr/.*/, structured_answer => any_structured_answer()), + 'What is the decoded html entity for π?' => test_zci(re(qr/.*/), structured_answer => any_structured_answer()), # natural querying - 'what is decoded html entity for #960 ?' => test_zci(qr/.*/, structured_answer => any_structured_answer()), + 'what is decoded html entity for #960 ?' => test_zci(re(qr/.*/), structured_answer => any_structured_answer()), # no "html" in query - 'the decoded entity for ō is?' => test_zci(qr/.*/, structured_answer => any_structured_answer()), + 'the decoded entity for ō is?' => test_zci(re(qr/.*/), structured_answer => any_structured_answer()), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/HTMLEntitiesEncode.t b/t/HTMLEntitiesEncode.t index 191f23f3f..5be90e191 100755 --- a/t/HTMLEntitiesEncode.t +++ b/t/HTMLEntitiesEncode.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -12,7 +13,7 @@ zci is_cached => 1; sub make_structured_answer { my ($qr) = @_; return { - input => '-ANY-', + input => ignore(), operation => "HTML Entity Encode", result => $qr, }; @@ -40,26 +41,26 @@ ddg_goodie_test( [qw(DDG::Goodie::HTMLEntitiesEncode)], # Simple tests - 'html code em dash' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(qr/mdash/)), - 'html em dash' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(qr/mdash/)), - 'em-dash html' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(qr/mdash/)), # hyphens ignored - 'html encode "em-dash"' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(qr/mdash/)), # quotes ignored - 'ApoSTrophe escapehtml' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(qr/#39/)), # mixed cases in query + 'html code em dash' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(re(qr/mdash/))), + 'html em dash' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(re(qr/mdash/))), + 'em-dash html' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(re(qr/mdash/))), # hyphens ignored + 'html encode "em-dash"' => test_zci("Encoded HTML Entity: —", structured_answer => make_structured_answer(re(qr/mdash/))), # quotes ignored + 'ApoSTrophe escapehtml' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(re(qr/#39/))), # mixed cases in query # Basic varieties in querying accented chars - 'html entity A-acute' => test_zci("Encoded HTML Entity: Á",structured_answer => make_structured_answer(qr/Aacute/)), - 'html entity for E Grave' => test_zci("Encoded HTML Entity: È", structured_answer => make_structured_answer(qr/Egrave/)), - 'html Ograve' => test_zci("Encoded HTML Entity: Ò", structured_answer => make_structured_answer(qr/Ograve/)), + 'html entity A-acute' => test_zci("Encoded HTML Entity: Á",structured_answer => make_structured_answer(re(qr/Aacute/))), + 'html entity for E Grave' => test_zci("Encoded HTML Entity: È", structured_answer => make_structured_answer(re(qr/Egrave/))), + 'html Ograve' => test_zci("Encoded HTML Entity: Ò", structured_answer => make_structured_answer(re(qr/Ograve/))), # Single typed-in character queries - 'html escape &' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(qr/amp/)), # & - 'html escape "' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(qr/quot/)), # " - 'how to html escape &?' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(qr/amp/)), # ? - 'how to html escape "&"?' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(qr/amp/)), # & - 'how to html escape ??' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(qr/#63/)), # ? - 'how do you html escape a "?"?' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(qr/#63/)), # ? - 'html escape """' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(qr/quot/)), # " - '$ sign htmlentity' => test_zci("Encoded HTML Entity: $", structured_answer => make_structured_answer(qr/#36/)), # $ + 'html escape &' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(re(qr/amp/))), # & + 'html escape "' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(re(qr/quot/))), # " + 'how to html escape &?' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(re(qr/amp/))), # ? + 'how to html escape "&"?' => test_zci("Encoded HTML Entity: &", structured_answer => make_structured_answer(re(qr/amp/))), # & + 'how to html escape ??' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(re(qr/#63/))), # ? + 'how do you html escape a "?"?' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(re(qr/#63/))), # ? + 'html escape """' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(re(qr/quot/))), # " + '$ sign htmlentity' => test_zci("Encoded HTML Entity: $", structured_answer => make_structured_answer(re(qr/#36/))), # $ # Return two matching entities for ambiguous query 'pound symbol html encode ' => test_zci( @@ -71,9 +72,9 @@ ddg_goodie_test( ), # Ignore words and whitespace - 'html code of pilcrow sign' => test_zci("Encoded HTML Entity: ¶", structured_answer => make_structured_answer(qr/#182/)), # of, sign - 'html escape greater than symbol' => test_zci("Encoded HTML Entity: >", structured_answer => make_structured_answer(qr/gt/)), # symbol - 'space html character code' => test_zci("Encoded HTML Entity:  ", structured_answer => make_structured_answer(qr/nbsp/)), # Ignore extra whitespace + 'html code of pilcrow sign' => test_zci("Encoded HTML Entity: ¶", structured_answer => make_structured_answer(re(qr/#182/))), # of, sign + 'html escape greater than symbol' => test_zci("Encoded HTML Entity: >", structured_answer => make_structured_answer(re(qr/gt/))), # symbol + 'space html character code' => test_zci("Encoded HTML Entity:  ", structured_answer => make_structured_answer(re(qr/nbsp/))), # Ignore extra whitespace # Better hash hits substitutions # 'right angle brackets' should work even though the defined key contains the singular 'bracket' @@ -85,7 +86,7 @@ ddg_goodie_test( }, ["Single right pointing angle quote (›)", "Double right pointing angle quote (»)"], "right angle brackets") ), # 'double quotes' should work even though the defined key contains the singular 'quote' - 'double quotes htmlescape' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(qr/quot/)), + 'double quotes htmlescape' => test_zci("Encoded HTML Entity: "", structured_answer => make_structured_answer(re(qr/quot/))), # Should not work 'html encode +' => undef, @@ -93,24 +94,24 @@ ddg_goodie_test( 'html encode is it magic' => undef, # Natural querying - 'What is the html character code for pi' => test_zci("Encoded HTML Entity: π", structured_answer => make_structured_answer(qr/#960/)), - 'whatis html entity for en-dash' => test_zci("Encoded HTML Entity: –", structured_answer => make_structured_answer(qr/ndash/)), # whatis spelling - 'how do I escape the greater-than symbol html' => test_zci("Encoded HTML Entity: >", structured_answer => make_structured_answer(qr/gt/)), + 'What is the html character code for pi' => test_zci("Encoded HTML Entity: π", structured_answer => make_structured_answer(re(qr/#960/))), + 'whatis html entity for en-dash' => test_zci("Encoded HTML Entity: –", structured_answer => make_structured_answer(re(qr/ndash/))), # whatis spelling + 'how do I escape the greater-than symbol html' => test_zci("Encoded HTML Entity: >", structured_answer => make_structured_answer(re(qr/gt/))), # the "a/A" belonging to "acute" matters, but the "a" immediately after "character" is removed - 'How to get a a acute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(qr/aacute/)), - 'how to get a a-acute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(qr/aacute/)), - 'how to get a aacute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(qr/aacute/)), - 'how to get a A acute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(qr/Aacute/)), - 'how to get a A-acute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(qr/Aacute/)), - 'how to get a Aacute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(qr/Aacute/)), + 'How to get a a acute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(re(qr/aacute/))), + 'how to get a a-acute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(re(qr/aacute/))), + 'how to get a aacute character in html code' => test_zci("Encoded HTML Entity: á", structured_answer => make_structured_answer(re(qr/aacute/))), + 'how to get a A acute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(re(qr/Aacute/))), + 'how to get a A-acute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(re(qr/Aacute/))), + 'how to get a Aacute character in html code' => test_zci("Encoded HTML Entity: Á", structured_answer => make_structured_answer(re(qr/Aacute/))), # Question marks ignored - 'the encoded html entity of apostrophe is?' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(qr/#39/)), - 'how to encode an apostrophe in html ? ' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(qr/#39/)), # spaces around the end + 'the encoded html entity of apostrophe is?' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(re(qr/#39/))), + 'how to encode an apostrophe in html ? ' => test_zci("Encoded HTML Entity: '", structured_answer => make_structured_answer(re(qr/#39/))), # spaces around the end # Question mark matters - 'how to encode "?" in html' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(qr/#63/)), + 'how to encode "?" in html' => test_zci("Encoded HTML Entity: ?", structured_answer => make_structured_answer(re(qr/#63/))), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/HelpLine.t b/t/HelpLine.t index d0ff672db..45f00e113 100644 --- a/t/HelpLine.t +++ b/t/HelpLine.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use DDG::Test::Location; use DDG::Request; @@ -48,7 +49,7 @@ ddg_goodie_test( query_raw => "$query", location => test_location("$locations[$_]") ), - test_zci(qr/24 Hour Suicide Hotline/, structured_answer => { input => [], operation => qr/24 Hour Suicide Hotline/, result => qr/[0-9]{2}/}), + test_zci(re(qr/24 Hour Suicide Hotline/), structured_answer => { input => [], operation => re(qr/24 Hour Suicide Hotline/), result => re(qr/[0-9]{2}/)}), } 0 .. scalar @locations - 1 } 0 .. scalar @queries - 1), (map { @@ -63,4 +64,4 @@ ddg_goodie_test( } 0 .. scalar @ok_queries - 1), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/HexToASCII.t b/t/HexToASCII.t index ab1531e0c..ffab0cf03 100644 --- a/t/HexToASCII.t +++ b/t/HexToASCII.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'ascii'; @@ -35,4 +36,4 @@ ddg_goodie_test( 'ascii 0x466f7220736f6d6520726561736f6e2c2049206465636964656420746f2061736b20612073656172636820656e67696e6520746f20636f6e766572742068657820746f2041534349492e0d0a436f6f6c2c20746869732073656172636820656e67696e6520646f65732069742c20756e74696c20492072756e206f7574206f662073706163652e' => build_test('0x466f7220736f6d6520726561736f6e2c2049206465636964656420746f2061736b20612073656172636820656e67696e6520746f20636f6e766572742068657820746f2041534349492e0d0a436f6f6c2c20746869732073656172636820656e67696e6520646f65732069742c20756e74696c20492072756e206f7574206f662073706163652e', 'For some reason, I decided to ask a search engine to convert hex to ASCII.[CR][LF]Cool, this search engine does it, until I run out of …'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/HexToDec.t b/t/HexToDec.t index cf430da76..4396a2570 100755 --- a/t/HexToDec.t +++ b/t/HexToDec.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'hex_to_dec'; @@ -62,4 +63,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/IDN.t b/t/IDN.t index 91468d836..c3c39914b 100644 --- a/t/IDN.t +++ b/t/IDN.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -27,4 +28,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/IPS.t b/t/IPS.t index af5d1d536..4d62ddf61 100644 --- a/t/IPS.t +++ b/t/IPS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'ips'; @@ -28,4 +29,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/ISO639.t b/t/ISO639.t index e8da4eb80..defe46f81 100644 --- a/t/ISO639.t +++ b/t/ISO639.t @@ -5,6 +5,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "iso639"; @@ -55,4 +56,4 @@ ddg_goodie_test( "iso639 xyz" => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/IndependenceDay.t b/t/IndependenceDay.t index 4e7961c8e..9c4097a6e 100644 --- a/t/IndependenceDay.t +++ b/t/IndependenceDay.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Locale::Country; @@ -50,4 +51,4 @@ ddg_goodie_test( "day of independence of bhutan" => answer("Bhutan", "December 17th, 1907") ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Jira.t b/t/Jira.t index c2c4789f8..fa3a63d4f 100644 --- a/t/Jira.t +++ b/t/Jira.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'jira'; @@ -61,4 +62,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/JohnCena.t b/t/JohnCena.t index d49d8134d..8cb531dae 100644 --- a/t/JohnCena.t +++ b/t/JohnCena.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "john_cena"; @@ -32,4 +33,4 @@ ddg_goodie_test( 'famous wrestler' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Kana.t b/t/Kana.t index 91e76311c..9d14d6e72 100755 --- a/t/Kana.t +++ b/t/Kana.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -179,4 +180,4 @@ ddg_goodie_test( 'ハ.ツha.tsu in romaji' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/KernelTaint.t b/t/KernelTaint.t index 3cb14d1ec..9a6192cfa 100644 --- a/t/KernelTaint.t +++ b/t/KernelTaint.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'kernel_taint'; @@ -19,4 +20,4 @@ ddg_goodie_test( '2 kernel taint description' => test_zci('- A module was force loaded by insmod -f. Set by modutils >= 2.4.9 and module-init-tools.', html => '
  • A module was force loaded by insmod -f. Set by modutils >= 2.4.9 and module-init-tools.
Read more') ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/LaserShip.t b/t/LaserShip.t index 11df69b33..5d417181d 100644 --- a/t/LaserShip.t +++ b/t/LaserShip.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'lasership'; @@ -24,4 +25,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Latex.t b/t/Latex.t index e7b2b08b5..ef41a96b3 100644 --- a/t/Latex.t +++ b/t/Latex.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'Latex'; @@ -14,17 +15,17 @@ ddg_goodie_test( )], "latex integral" => test_zci('LaTeX command: \int_lowerbound^upperbound Example: $\int_a^b f(x)dx$', - html => qr/\\int_lowerbound\^upperbound/, + html => re(qr/\\int_lowerbound\^upperbound/), heading => 'Integral (LaTeX)'), "tex integral" => test_zci('LaTeX command: \int_lowerbound^upperbound Example: $\int_a^b f(x)dx$', - html => qr/\\int_lowerbound\^upperbound/, + html => re(qr/\\int_lowerbound\^upperbound/), heading => 'Integral (LaTeX)'), 'latex summation' => test_zci('LaTeX command: \sum_{lower}^{upper} Example: $\sum_{i=0}^{10} x^{2}$', - html => qr/\\sum_\{lower\}\^\{upper\}/, + html => re(qr/\\sum_\{lower\}\^\{upper\}/), heading => 'Summation (LaTeX)'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/LeapYear.t b/t/LeapYear.t index a7eeece34..9bf07f3e2 100755 --- a/t/LeapYear.t +++ b/t/LeapYear.t @@ -5,6 +5,7 @@ use warnings; use Test::MockTime qw( :all ); use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'leap_year'; @@ -137,4 +138,4 @@ ddg_goodie_test( ); restore_time(); -done_testing(); +done_testing(); \ No newline at end of file diff --git a/t/LeetSpeak.t b/t/LeetSpeak.t index 322e140e1..000c5e0f4 100644 --- a/t/LeetSpeak.t +++ b/t/LeetSpeak.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -56,4 +57,4 @@ ddg_goodie_test( 'l33tsp34k' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Loan.t b/t/Loan.t index 8aca23365..cd5e9c581 100644 --- a/t/Loan.t +++ b/t/Loan.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use DDG::Test::Location; use DDG::Request; @@ -237,4 +238,4 @@ ddg_goodie_test ( ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/LoremIpsum.t b/t/LoremIpsum.t index 71e40b64a..b67300c96 100644 --- a/t/LoremIpsum.t +++ b/t/LoremIpsum.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -9,8 +10,8 @@ zci is_cached => 0; sub build_result { my $result = shift; - return $result, structured_answer => { - data => "-ANY-", + return re($result), structured_answer => { + data => ignore(), meta => { sourceName => "Lipsum", sourceUrl => "http://lipsum.com/" @@ -83,4 +84,4 @@ ddg_goodie_test( ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Lowercase.t b/t/Lowercase.t index 8b8894d64..c66172dfb 100755 --- a/t/Lowercase.t +++ b/t/Lowercase.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'lowercase'; @@ -38,4 +39,4 @@ ddg_goodie_test( 'how to lowercase text' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MD4.t b/t/MD4.t index a6f29452a..68b81b136 100644 --- a/t/MD4.t +++ b/t/MD4.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "md4"; @@ -85,4 +86,4 @@ ddg_goodie_test( 'md5 this string' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MD5.t b/t/MD5.t index 1d8ec8560..f73410474 100644 --- a/t/MD5.t +++ b/t/MD5.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'md5'; @@ -180,4 +181,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MacAddress.t b/t/MacAddress.t index 92bd8f181..2d90d65c2 100644 --- a/t/MacAddress.t +++ b/t/MacAddress.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "mac_address"; @@ -57,4 +58,4 @@ ddg_goodie_test( 'mac address 1E:00:00:00:00:00' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MagicEightBall.t b/t/MagicEightBall.t index 3794f532d..c63e556cc 100644 --- a/t/MagicEightBall.t +++ b/t/MagicEightBall.t @@ -3,14 +3,15 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "magic_eight_ball"; zci is_cached => 0; -my $possibleAnswers = qr/(It is certain|It is decidedly so|Without a doubt|Yes, definitely|You may rely on it|As I see it, yes|Most likely|Outlook good|Yes|Signs point to yes|Reply hazy try again|Ask again later|Better not tell you now|Cannot predict now|Concentrate and ask again|Don't count on it|My reply is no|My sources say no|Outlook not so good|Very doubtful)/; +my $possibleAnswers = re(qr/(It is certain|It is decidedly so|Without a doubt|Yes, definitely|You may rely on it|As I see it, yes|Most likely|Outlook good|Yes|Signs point to yes|Reply hazy try again|Ask again later|Better not tell you now|Cannot predict now|Concentrate and ask again|Don't count on it|My reply is no|My sources say no|Outlook not so good|Very doubtful)/); -my $possibleStructuredAnswer = qr/^(?:It is certain|It is decidedly so|Without a doubt|Yes, definitely|You may rely on it|As I see it, yes|Most likely|Outlook good|Yes|Signs point to yes|Reply hazy try again|Ask again later|Better not tell you now|Cannot predict now|Concentrate and ask again|Don't count on it|My reply is no|My sources say no|Outlook not so good|Very doubtful)$/; +my $possibleStructuredAnswer = re(qr/^(?:It is certain|It is decidedly so|Without a doubt|Yes, definitely|You may rely on it|As I see it, yes|Most likely|Outlook good|Yes|Signs point to yes|Reply hazy try again|Ask again later|Better not tell you now|Cannot predict now|Concentrate and ask again|Don't count on it|My reply is no|My sources say no|Outlook not so good|Very doubtful)$/); ddg_goodie_test( [qw( DDG::Goodie::MagicEightBall )], @@ -43,4 +44,4 @@ ddg_goodie_test( 'magic 8ball' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MakeMeASandwich.t b/t/MakeMeASandwich.t index 1309c5d25..25609a966 100644 --- a/t/MakeMeASandwich.t +++ b/t/MakeMeASandwich.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'xkcd_sandwich'; @@ -34,4 +35,4 @@ ddg_goodie_test( '0 make me a sandwich' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MarkdownReference.t b/t/MarkdownReference.t index f943822f3..724d84f79 100644 --- a/t/MarkdownReference.t +++ b/t/MarkdownReference.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'markdown_reference'; @@ -71,4 +72,4 @@ ddg_goodie_test( 'markdown cheat sheet list' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Minecraft.t b/t/Minecraft.t index 375019d5e..5694bfa78 100644 --- a/t/Minecraft.t +++ b/t/Minecraft.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use URI::Escape; @@ -141,4 +142,4 @@ sub make_structured_answer { }; }; -done_testing; +done_testing; \ No newline at end of file diff --git a/t/MoonPhases.t b/t/MoonPhases.t index 0478d15fb..c9d972d43 100644 --- a/t/MoonPhases.t +++ b/t/MoonPhases.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'moon_phase'; @@ -14,8 +15,8 @@ my $quarter = qr/(?:First|Third)$space_plus(?:Quarter)/; my $named = qr/(?:New|Full)$space_plus(?:Moon)/; my $phases = qr/$wax_wane|$quarter|$named/; -my $ascii_answer = qr/^The current lunar phase is: $phases$/; -my $html_answer = qr%^The current lunar phase is: $phases$%; +my $ascii_answer = re(qr/^The current lunar phase is: $phases$/); +my $html_answer = re(qr%^The current lunar phase is: $phases$%); ddg_goodie_test( [qw( DDG::Goodie::MoonPhases)], @@ -24,7 +25,7 @@ ddg_goodie_test( structured_answer => { input => [], operation => 'Current lunar phase', - result => $phases, + result => re($phases), } ), 'lunar phase' => test_zci( @@ -32,7 +33,7 @@ ddg_goodie_test( structured_answer => { input => [], operation => 'Current lunar phase', - result => $phases, + result => re($phases), } ), 'phase of the moon' => test_zci( @@ -40,7 +41,7 @@ ddg_goodie_test( structured_answer => { input => [], operation => 'Current lunar phase', - result => $phases, + result => re($phases), } ), 'what is the current lunar phase' => test_zci( @@ -48,9 +49,9 @@ ddg_goodie_test( structured_answer => { input => [], operation => 'Current lunar phase', - result => $phases, + result => re($phases), } ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Morse.t b/t/Morse.t index 05fe2e18f..06f42cf3b 100644 --- a/t/Morse.t +++ b/t/Morse.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'morse'; @@ -43,4 +44,4 @@ ddg_goodie_test([qw( 'morse code for cheat sheet' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/NLetterWords.t b/t/NLetterWords.t index f722f128e..5d4ecd252 100644 --- a/t/NLetterWords.t +++ b/t/NLetterWords.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'nletterwords'; @@ -16,8 +17,8 @@ ddg_goodie_test( '1 char words' => test_zci('Random 1 letter words: a, I.'), '1 character word' => test_zci('Random 1 letter words: a, I.'), 'one letter words' => test_zci('Random 1 letter words: a, I.'), - '5 letter words' => test_zci(qr/Random 5 letter words: ((\w){5},? ?){30}/), - '12 character word' => test_zci(qr/Random 12 letter words: ((\w){12},? ?){30}/), + '5 letter words' => test_zci(re(qr/Random 5 letter words: ((\w){5},? ?){30}/)), + '12 character word' => test_zci(re(qr/Random 12 letter words: ((\w){12},? ?){30}/)), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/NameDays.t b/t/NameDays.t index a7487c353..dc016506d 100644 --- a/t/NameDays.t +++ b/t/NameDays.t @@ -5,6 +5,7 @@ use strict; use warnings; use Locale::Country; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "name_days"; @@ -176,4 +177,4 @@ ddg_goodie_test( 'name day' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/NoteFrequency.t b/t/NoteFrequency.t index 37d353184..9b12aa319 100644 --- a/t/NoteFrequency.t +++ b/t/NoteFrequency.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "note_frequency"; @@ -37,4 +38,4 @@ ddg_goodie_test( "notefreq c9" => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/OnionAddress.t b/t/OnionAddress.t index e9fa03c8f..ad23093a7 100644 --- a/t/OnionAddress.t +++ b/t/OnionAddress.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use URI::Escape; @@ -165,4 +166,4 @@ sub make_structured_answer { }; }; -done_testing; +done_testing; \ No newline at end of file diff --git a/t/POTUS.t b/t/POTUS.t index 9b4ac77b5..f512a9b6b 100755 --- a/t/POTUS.t +++ b/t/POTUS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'potus'; @@ -40,4 +41,4 @@ ddg_goodie_test( 'VPOTUS' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PaleoIngredientCheck.t b/t/PaleoIngredientCheck.t index 87b4e560a..a87bf786b 100644 --- a/t/PaleoIngredientCheck.t +++ b/t/PaleoIngredientCheck.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "paleo_ingredient_check"; diff --git a/t/Palindrome.t b/t/Palindrome.t index 4f528d494..655e02a3d 100644 --- a/t/Palindrome.t +++ b/t/Palindrome.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'palindrome'; @@ -22,4 +23,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Paper.t b/t/Paper.t index ab959e309..6e6bb8812 100644 --- a/t/Paper.t +++ b/t/Paper.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'paper'; @@ -76,4 +77,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Parcelforce.t b/t/Parcelforce.t index ce4255b48..dc0799eb9 100644 --- a/t/Parcelforce.t +++ b/t/Parcelforce.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'parcelforce'; @@ -31,4 +32,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/ParseCron.t b/t/ParseCron.t index 7d21d243e..713236a02 100644 --- a/t/ParseCron.t +++ b/t/ParseCron.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'parsecron'; @@ -368,4 +369,4 @@ ddg_goodie_test( }), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Passphrase.t b/t/Passphrase.t index 95ad3610c..9dd5189fc 100644 --- a/t/Passphrase.t +++ b/t/Passphrase.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'random_passphrase'; @@ -46,12 +47,12 @@ sub count_words { my $words_re = qr/(?:\s?\b[a-z]+\b){$count}/; return ( - qr/^random passphrase: $words_re$/, + re(qr/^random passphrase: $words_re$/), structured_answer => { input => [($count > 1) ? $count . ' words' : '1 word'], operation => 'Random passphrase', - result => qr/^$words_re$/, + result => re(qr/^$words_re$/), }); } -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Password.t b/t/Password.t index c1b1a0862..9f362589c 100644 --- a/t/Password.t +++ b/t/Password.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'pw'; @@ -11,157 +12,157 @@ zci is_cached => 0; ddg_goodie_test( [qw( DDG::Goodie::Password)], 'pw 15 average' => test_zci( - qr/.{15} \(random password\)/, + re(qr/.{15} \(random password\)/), structured_answer => { input => ['15 characters', 'average strength'], operation => 'Random password', - result => qr/^.{15}$/ + result => re(qr/^.{15}$/) } ), 'password normal 15' => test_zci( - qr/.{15} \(random password\)/, + re(qr/.{15} \(random password\)/), structured_answer => { input => ['15 characters', 'average strength'], operation => 'Random password', - result => qr/^.{15}$/ + result => re(qr/^.{15}$/) } ), 'random pw 15 AVG' => test_zci( - qr/.{15} \(random password\)/, + re(qr/.{15} \(random password\)/), structured_answer => { input => ['15 characters', 'average strength'], operation => 'Random password', - result => qr/^.{15}$/ + result => re(qr/^.{15}$/) } ), 'pwgen strong 25' => test_zci( - qr/.{25} \(random password\)/, + re(qr/.{25} \(random password\)/), structured_answer => { input => ['25 characters', 'high strength'], operation => 'Random password', - result => qr/^.{25}$/ + result => re(qr/^.{25}$/) } ), 'password 25 hard' => test_zci( - qr/.{25} \(random password\)/, + re(qr/.{25} \(random password\)/), structured_answer => { input => ['25 characters', 'high strength'], operation => 'Random password', - result => qr/^.{25}$/ + result => re(qr/^.{25}$/) } ), 'Password High 25' => test_zci( - qr/.{25} \(random password\)/, + re(qr/.{25} \(random password\)/), structured_answer => { input => ['25 characters', 'high strength'], operation => 'Random password', - result => qr/^.{25}$/ + result => re(qr/^.{25}$/) } ), # Example queries 'random password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'password strong 15' => test_zci( - qr/.{15} \(random password\)/, + re(qr/.{15} \(random password\)/), structured_answer => { input => ['15 characters', 'high strength'], operation => 'Random password', - result => qr/^.{15}$/ + result => re(qr/^.{15}$/) } ), 'pw' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), # Add some triggers (issue #1565) 'generate password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'generate strong password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'high strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'generate random password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'password generator' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'random password generator' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'random strong password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'high strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'random password 16 characters' => test_zci( - qr/.{16} \(random password\)/, + re(qr/.{16} \(random password\)/), structured_answer => { input => ['16 characters', 'average strength'], operation => 'Random password', - result => qr/^.{16}$/ + result => re(qr/^.{16}$/) } ), 'create random password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'average strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'strong random password' => test_zci( - qr/.{8} \(random password\)/, + re(qr/.{8} \(random password\)/), structured_answer => { input => ['8 characters', 'high strength'], operation => 'Random password', - result => qr/^.{8}$/ + result => re(qr/^.{8}$/) } ), 'random password strong 15' => test_zci( - qr/.{15} \(random password\)/, + re(qr/.{15} \(random password\)/), structured_answer => { input => ['15 characters', 'high strength'], operation => 'Random password', - result => qr/^.{15}$/ + result => re(qr/^.{15}$/) } ), 'password 65' => undef, @@ -178,4 +179,4 @@ ddg_goodie_test( 'potatoe generator' => undef ); -done_testing +done_testing \ No newline at end of file diff --git a/t/PercentError.t b/t/PercentError.t index d57e942e6..bb15048aa 100644 --- a/t/PercentError.t +++ b/t/PercentError.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'percent_error'; @@ -86,4 +87,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/PercentOf.t b/t/PercentOf.t index 08360cefe..5701bc27f 100644 --- a/t/PercentOf.t +++ b/t/PercentOf.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "percent_of"; @@ -72,4 +73,4 @@ ddg_goodie_test( '12+5t%' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Perimeter.t b/t/Perimeter.t index dab532e7b..49d610fdc 100644 --- a/t/Perimeter.t +++ b/t/Perimeter.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'perimeter'; @@ -55,4 +56,4 @@ ddg_goodie_test( 'perimeter of square 3' => test_zci(build_answer(12, 'square', 3)), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PeriodicTable.t b/t/PeriodicTable.t index dac26bcaa..b495f135c 100644 --- a/t/PeriodicTable.t +++ b/t/PeriodicTable.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "periodic_table"; @@ -437,4 +438,4 @@ sub make_structured_answer { }; }; -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PhoneAlphabet.t b/t/PhoneAlphabet.t index 6371b3c0e..3ea09c83c 100644 --- a/t/PhoneAlphabet.t +++ b/t/PhoneAlphabet.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "phone_alphabet"; @@ -59,4 +60,4 @@ ddg_goodie_test( '0x0123 to digits' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Phonetic.t b/t/Phonetic.t index 7d90c0dae..1bd8db927 100644 --- a/t/Phonetic.t +++ b/t/Phonetic.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'phonetic'; @@ -18,4 +19,4 @@ ddg_goodie_test( 'phonetic Who are you?' => test_zci('Phonetic: Whiskey-Hotel-Oscar Alfa-Romeo-Echo Yankee-Oscar-Uniform') ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Pi.t b/t/Pi.t index 9b5ebbb1f..13d822bab 100644 --- a/t/Pi.t +++ b/t/Pi.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -54,4 +55,4 @@ ddg_goodie_test( ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PigLatin.t b/t/PigLatin.t index 1712528a6..9a39fb6c1 100644 --- a/t/PigLatin.t +++ b/t/PigLatin.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'translation'; @@ -54,4 +55,4 @@ ddg_goodie_test( 'piglatin 0' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Poker.t b/t/Poker.t index 010876f6c..171420699 100644 --- a/t/Poker.t +++ b/t/Poker.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "poker"; @@ -34,4 +35,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PrimeFactors.t b/t/PrimeFactors.t index 379c66f66..2620440c2 100644 --- a/t/PrimeFactors.t +++ b/t/PrimeFactors.t @@ -5,6 +5,7 @@ use warnings; use utf8; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "prime_factors"; @@ -44,4 +45,4 @@ ddg_goodie_test( 'optimus prime 45' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PrimeNumber.t b/t/PrimeNumber.t index acfeabe15..d4af908a1 100644 --- a/t/PrimeNumber.t +++ b/t/PrimeNumber.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "prime"; @@ -75,4 +76,4 @@ sub make_structured_answer { }; }; -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PrivateNetwork.t b/t/PrivateNetwork.t index bc079cbbb..ca02ede3c 100644 --- a/t/PrivateNetwork.t +++ b/t/PrivateNetwork.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'private_network'; @@ -30,8 +31,8 @@ Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15 Private network IPv6 addresses (rfc4193): Unique local addresses: fd00::/8 ', - html => qr#.*# + html => re(qr#.*#) )) } ( 'private network', 'private networks', 'private ips' ) ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/PublicDNS.t b/t/PublicDNS.t index 3ff625c27..b3380d49e 100644 --- a/t/PublicDNS.t +++ b/t/PublicDNS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "public_dns"; @@ -11,13 +12,13 @@ zci is_cached => 1; # We don't want to test too specifically on the included data, so just confirm # we got an answer with something approaching the correct form. # Hopefully, some one has eyeballed the output to make sure its got the right data. -my $text_table = qr#^\+-+.*-+\+#m; +my $text_table = re(qr#^\+-+.*-+\+#m); ddg_goodie_test([qw( DDG::Goodie::PublicDNS)], 'public dns' => test_zci( $text_table, structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -29,7 +30,7 @@ ddg_goodie_test([qw( DDG::Goodie::PublicDNS)], 'dns servers' => test_zci( $text_table, structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -40,4 +41,4 @@ ddg_goodie_test([qw( DDG::Goodie::PublicDNS)], ) ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/RIPEMD.t b/t/RIPEMD.t index 7efd28f6d..eebae4665 100644 --- a/t/RIPEMD.t +++ b/t/RIPEMD.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "ripemd"; @@ -422,4 +423,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Rafl.t b/t/Rafl.t index 1e4c83519..f8257b38a 100644 --- a/t/Rafl.t +++ b/t/Rafl.t @@ -3,12 +3,13 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'rafl'; zci is_cached => 1; -my $intro = qr/^rafl is so everywhere, /; +my $intro = re(qr/^rafl is so everywhere, /); my @rafl = ( $intro, structured_answer => { @@ -24,4 +25,4 @@ ddg_goodie_test( 'where is rafl?' => test_zci(@rafl), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Randagram.t b/t/Randagram.t index fecd224f5..4acca21af 100644 --- a/t/Randagram.t +++ b/t/Randagram.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'randagram'; @@ -10,8 +11,8 @@ zci is_cached => 0; ddg_goodie_test( [qw(DDG::Goodie::Randagram)], - 'randagram algorithm' => test_zci(qr/Randagram of "algorithm": [algorithm]/), - 'randagram jazz hands' => test_zci(qr/Randagram of "jazz hands": [jazz hands]/), + 'randagram algorithm' => test_zci(re(qr/Randagram of "algorithm": [algorithm]/)), + 'randagram jazz hands' => test_zci(re(qr/Randagram of "jazz hands": [jazz hands]/)), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/RandomName.t b/t/RandomName.t index 8301b6a28..2db649b8d 100644 --- a/t/RandomName.t +++ b/t/RandomName.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci is_cached => 0; @@ -12,14 +13,14 @@ ddg_goodie_test( [ 'DDG::Goodie::RandomName' ], - 'random Name' => test_zci (qr/\w\w \(random\)/), - 'random name' => test_zci (qr/\w\w \(random\)/), + 'random Name' => test_zci (re(qr/\w\w \(random\)/)), + 'random name' => test_zci (re(qr/\w\w \(random\)/)), 'random person' => - test_zci (qr/Name: [\w\s]+\nGender: (?:Male|Female)\nDate of birth: \d{4}\-\d{2}\-\d{2}\nAge: \d+/, + test_zci (re(qr/Name: [\w\s]+\nGender: (?:Male|Female)\nDate of birth: \d{4}\-\d{2}\-\d{2}\nAge: \d+/), heading => 'Random Person'), 'random domain name' => undef, 'random city name' => undef, 'names of random people' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/RandomNumber.t b/t/RandomNumber.t index 8fe555c9f..0d6bf944a 100644 --- a/t/RandomNumber.t +++ b/t/RandomNumber.t @@ -40,4 +40,4 @@ ddg_goodie_test( 'random access' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Rc4.t b/t/Rc4.t index 62e1f0fcf..58f112b42 100644 --- a/t/Rc4.t +++ b/t/Rc4.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "rc4"; @@ -29,4 +30,4 @@ ddg_goodie_test( 'rc4 no operation' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Regexp.t b/t/Regexp.t index 633cfaa6f..7e4f5026d 100644 --- a/t/Regexp.t +++ b/t/Regexp.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'regexp'; @@ -84,4 +85,4 @@ ddg_goodie_test([qw( DDG::Goodie::Regexp )], #'regexp /(?h)/ h' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ResistorColors.t b/t/ResistorColors.t index 62a84bba6..ebfc38e99 100644 --- a/t/ResistorColors.t +++ b/t/ResistorColors.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "resistor_colors"; @@ -35,7 +36,7 @@ sub get_structured_answer { sourceName => "resisto.rs", sourceUrl => "http://resisto.rs/#" . $_[0] }, - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -142,4 +143,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Reverse.t b/t/Reverse.t index e6aceda4c..00ff2845f 100644 --- a/t/Reverse.t +++ b/t/Reverse.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'reverse'; @@ -44,4 +45,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/ReverseComplement.t b/t/ReverseComplement.t index cb3b58587..330b167ce 100644 --- a/t/ReverseComplement.t +++ b/t/ReverseComplement.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'reverse_complement'; @@ -97,4 +98,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/ReverseResistorColours.t b/t/ReverseResistorColours.t index 517d7c62b..8abc7d005 100644 --- a/t/ReverseResistorColours.t +++ b/t/ReverseResistorColours.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -115,4 +116,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Roman.t b/t/Roman.t index 4ce2a1616..3d9c839ef 100644 --- a/t/Roman.t +++ b/t/Roman.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'roman_numeral_conversion'; @@ -76,4 +77,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Rot13.t b/t/Rot13.t index 2519c5d59..157191259 100644 --- a/t/Rot13.t +++ b/t/Rot13.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'rot13'; @@ -36,4 +37,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/RouterPasswords.t b/t/RouterPasswords.t index 31c34b181..63a5b1e4a 100644 --- a/t/RouterPasswords.t +++ b/t/RouterPasswords.t @@ -5,6 +5,7 @@ use warnings; # These modules are necessary for the functions we'll be running. use Test::More; +use Test::Deep; use DDG::Test::Goodie; # These zci attributes aren't necessary, but if you specify them inside your @@ -59,4 +60,4 @@ ddg_goodie_test( # This function call is expected by Test::More. It makes sure the program # doesn't exit before all the tests have been run. -done_testing; +done_testing; \ No newline at end of file diff --git a/t/RubiksCubePatterns.t b/t/RubiksCubePatterns.t index 48f7601f3..e90a54ae2 100644 --- a/t/RubiksCubePatterns.t +++ b/t/RubiksCubePatterns.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'rubiks_cube'; @@ -162,4 +163,4 @@ ddg_goodie_test( 'rubics cube' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SHA3.t b/t/SHA3.t index 82555e4f9..04438a7dd 100644 --- a/t/SHA3.t +++ b/t/SHA3.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "sha3"; @@ -349,4 +350,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/Scramble.t b/t/Scramble.t index a489c8c13..38ba82d77 100644 --- a/t/Scramble.t +++ b/t/Scramble.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "scramble"; @@ -15,7 +16,7 @@ ddg_goodie_test( structured_answer => { input => ['filter'], operation => 'Scramble of', - result => '-ANY-', + result => ignore(), } ), 'scramble of' => undef, @@ -24,4 +25,4 @@ ddg_goodie_test( 'Scrambles for "867-5309"' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ScreenResolution.t b/t/ScreenResolution.t index 99e2dd852..2ab3e1ee6 100644 --- a/t/ScreenResolution.t +++ b/t/ScreenResolution.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "screen_resolution"; @@ -35,4 +36,4 @@ ddg_goodie_test( 'blah blah screen resolution' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SecurityAddons.t b/t/SecurityAddons.t index 822dd4c24..35e8885b3 100644 --- a/t/SecurityAddons.t +++ b/t/SecurityAddons.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "security_addons"; @@ -56,4 +57,4 @@ ddg_goodie_test( 'internet explorer privacy addons' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Sha.t b/t/Sha.t index a9d07f922..5a17c48c9 100644 --- a/t/Sha.t +++ b/t/Sha.t @@ -4,6 +4,7 @@ use utf8; use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'sha'; @@ -217,4 +218,4 @@ ddg_goodie_test( 'shadow' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Shruggie.t b/t/Shruggie.t index 6cc35fd51..7d00865e8 100644 --- a/t/Shruggie.t +++ b/t/Shruggie.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; # needed to properly use the various unicode characters in the emoticons @@ -86,4 +87,4 @@ ddg_goodie_test( 'shruggie andover' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SigFigs.t b/t/SigFigs.t index 228eb4550..cbc48f732 100644 --- a/t/SigFigs.t +++ b/t/SigFigs.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'sig_figs'; @@ -50,4 +51,4 @@ ddg_goodie_test( 'How many sig figs are there in 11.3' => build_test('3', '11.3'), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SolarSystem.t b/t/SolarSystem.t index 5aa629cf8..0bb2a8644 100644 --- a/t/SolarSystem.t +++ b/t/SolarSystem.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use DDG::Test::Location; @@ -11,7 +12,7 @@ zci is_cached => 1; #Structured answer template data my $templateData = { - data => '-ANY-', + data => ignore(), meta => { sourceUrl => "https://solarsystem.nasa.gov/planets/index.cfm", sourceName => "NASA" diff --git a/t/Sort.t b/t/Sort.t index 043e6546e..10592a24d 100644 --- a/t/Sort.t +++ b/t/Sort.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'sort'; @@ -79,4 +80,4 @@ ddg_goodie_test( 'sort' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Stardate.t b/t/Stardate.t index 9628640bb..2a7a8ae4b 100644 --- a/t/Stardate.t +++ b/t/Stardate.t @@ -3,15 +3,16 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "stardate"; zci is_cached => 0; sub build_structured_answer { - return qr/[0-9]{8}\.[0-9]{1,5}/, + return re(qr/[0-9]{8}\.[0-9]{1,5}/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', }, @@ -29,4 +30,4 @@ ddg_goodie_test( 'stardate 29 feb 2015' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SubnetCalc.t b/t/SubnetCalc.t index cf12eea1b..f11e0bbf3 100755 --- a/t/SubnetCalc.t +++ b/t/SubnetCalc.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'subnet_calc'; @@ -96,4 +97,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Sudoku.t b/t/Sudoku.t index 054bf8782..9eb1f6f49 100644 --- a/t/Sudoku.t +++ b/t/Sudoku.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'sudoku'; @@ -14,31 +15,31 @@ ddg_goodie_test( 'DDG::Goodie::Sudoku' ], "sudoku" => test_zci( - qr/^[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/^[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), "play sudoku" => test_zci( - qr/^[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/^[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), "easy sudoku" => test_zci( - qr/^[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/^[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), "sudoku hard" => test_zci( - qr/^[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/^[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), "generate sudoku" => test_zci( - qr/^[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/^[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), "sudoku party" => undef, "sudoku toys" => undef, 'sudoku easy' => test_zci( - qr/[0-9_].*[0-9_]$/s, - html => qr/.*\.*/s, + re(qr/[0-9_].*[0-9_]$/s), + html => re(qr/.*\.*/s), ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SumOfNaturalNumbers.t b/t/SumOfNaturalNumbers.t index 29db10daf..aa9aa54d3 100644 --- a/t/SumOfNaturalNumbers.t +++ b/t/SumOfNaturalNumbers.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci is_cached => 1; @@ -26,4 +27,4 @@ ddg_goodie_test( 'add ten to twenty' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/SunInfo.t b/t/SunInfo.t index f558ca850..c86941c07 100755 --- a/t/SunInfo.t +++ b/t/SunInfo.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; use Test::MockTime qw(set_fixed_time); @@ -12,9 +13,9 @@ zci is_cached => 0; set_fixed_time('2014-08-01T00:00:00Z'); # Presume sun will rise in the morning and set at night year round in PA. -my @now = (qr/^On.*Phoenixville, Pennsylvania.*AM.*PM\.$/, +my @now = (re(qr/^On.*Phoenixville, Pennsylvania.*AM.*PM\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -25,9 +26,9 @@ my @now = (qr/^On.*Phoenixville, Pennsylvania.*AM.*PM\.$/, } } ); -my @aug = (qr/^On 30 Aug.*AM.*PM\.$/, +my @aug = (re(qr/^On 30 Aug.*AM.*PM\.$/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -73,9 +74,9 @@ ddg_goodie_test( 'sunset on 2015-01-01' => test_zci(@exact), 'what time is sunrise on 2015-01-01?' => test_zci(@exact), 'January 1st, 2015 sunrise' => test_zci(@exact), - q{sunrise at 39°57'N 5°10'W} => test_zci(qr"On.*Coordinates .*AM.*PM", + q{sunrise at 39°57'N 5°10'W} => test_zci(re(qr"On.*Coordinates .*AM.*PM"), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -86,9 +87,9 @@ ddg_goodie_test( } } ), - 'sunset at 1S 1W' => test_zci(qr"On .*, sunrise in Coordinates -1°N -1°E is at .*AM; sunset at .*PM.", + 'sunset at 1S 1W' => test_zci(re(qr"On .*, sunrise in Coordinates -1°N -1°E is at .*AM; sunset at .*PM."), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -101,7 +102,7 @@ ddg_goodie_test( ), 'sunset at 53N 2E on 2014-01-01' => test_zci("On 01 Jan 2014, sunrise in Coordinates 53°N 2°E is at 3:05 AM; sunset at 10:46 AM.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -114,7 +115,7 @@ ddg_goodie_test( ), 'sunset at 53N 2W on 2014-01-08' => test_zci("On 08 Jan 2014, sunrise in Coordinates 53°N -2°E is at 3:18 AM; sunset at 11:11 AM.", structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'text', item => 0, @@ -133,4 +134,4 @@ ddg_goodie_test( 'after the sunset' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Teredo.t b/t/Teredo.t index a423b3152..f2794fc83 100644 --- a/t/Teredo.t +++ b/t/Teredo.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'teredo'; @@ -80,4 +81,4 @@ ddg_goodie_test( ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/TimezoneConverter.t b/t/TimezoneConverter.t index 8a3cc6111..d359510da 100644 --- a/t/TimezoneConverter.t +++ b/t/TimezoneConverter.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -210,35 +211,35 @@ ddg_goodie_test( }, ), '11:22am cest in my timezone' => - test_zci(qr/5:22 AM EDT/, + test_zci(re(qr/5:22 AM EDT/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/5:22 AM EDT/, + result => re(qr/5:22 AM EDT/), }, ), '11:22am cest in localtime' => - test_zci(qr/5:22 AM EDT/, + test_zci(re(qr/5:22 AM EDT/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/5:22 AM EDT/, + result => re(qr/5:22 AM EDT/), }, ), '11:22am cest in my local timezone' => - test_zci(qr/5:22 AM EDT/, + test_zci(re(qr/5:22 AM EDT/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/5:22 AM EDT/, + result => re(qr/5:22 AM EDT/), }, ), '11:22am cest' => - test_zci(qr/5:22 AM EDT/, + test_zci(re(qr/5:22 AM EDT/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/5:22 AM EDT/, + result => re(qr/5:22 AM EDT/), }, ), '12pm my time in CEST' => @@ -314,19 +315,19 @@ ddg_goodie_test( }, ), '11:22am cest in my timezone' => - test_zci(qr/4:22 AM EST/, + test_zci(re(qr/4:22 AM EST/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/4:22 AM EST/, + result => re(qr/4:22 AM EST/), }, ), '11:22am cest in localtime' => - test_zci(qr/4:22 AM EST/, + test_zci(re(qr/4:22 AM EST/), structured_answer => { input => [qq/11:22 AM CEST (UTC+2) to $test_location_tz/], operation => 'Convert Timezone', - result => qr/4:22 AM EST/, + result => re(qr/4:22 AM EST/), }, ), '11:22am cest in my local timezone' => @@ -370,7 +371,7 @@ ddg_goodie_test( }, ), '12am my timezone in UTC' => - test_zci(qr/5:00 AM UTC/, + test_zci(re(qr/5:00 AM UTC/), structured_answer => { input => [qq/Midnight $test_location_tz to UTC/], operation => 'Convert Timezone', @@ -378,7 +379,7 @@ ddg_goodie_test( }, ), '12am local time in UTC' => - test_zci(qr/5:00 AM UTC/, + test_zci(re(qr/5:00 AM UTC/), structured_answer => { input => [qq/Midnight $test_location_tz to UTC/], operation => 'Convert Timezone', @@ -386,7 +387,7 @@ ddg_goodie_test( }, ), '12am in UTC' => - test_zci(qr/5:00 AM UTC/, + test_zci(re(qr/5:00 AM UTC/), structured_answer => { input => [qq/Midnight $test_location_tz to UTC/], operation => 'Convert Timezone', @@ -396,4 +397,4 @@ ddg_goodie_test( ); restore_time(); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Tips.t b/t/Tips.t index 7169359e5..433cda2ad 100644 --- a/t/Tips.t +++ b/t/Tips.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'tip'; @@ -25,4 +26,4 @@ ddg_goodie_test( '4 of 5 dentists' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/TitleCase.t b/t/TitleCase.t index 6de5bd04f..ad44cb0fd 100755 --- a/t/TitleCase.t +++ b/t/TitleCase.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'title_case'; @@ -34,4 +35,4 @@ ddg_goodie_test( 'how do i make something titlecase' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/TwelveOclock.t b/t/TwelveOclock.t index 89ccb971e..caf297043 100644 --- a/t/TwelveOclock.t +++ b/t/TwelveOclock.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "twelve_oclock"; @@ -72,4 +73,4 @@ ddg_goodie_test( 'when is noon in Jakarta?' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/UN.t b/t/UN.t index 81ebd0737..96ff83ab2 100644 --- a/t/UN.t +++ b/t/UN.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'united_nations'; @@ -64,4 +65,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/UPS.t b/t/UPS.t index f958ec6ce..d61211811 100644 --- a/t/UPS.t +++ b/t/UPS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'ups'; @@ -31,4 +32,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/URLDecode.t b/t/URLDecode.t index 996fdbe33..2de98a3eb 100755 --- a/t/URLDecode.t +++ b/t/URLDecode.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use HTML::Entities; use DDG::Test::Goodie; @@ -63,4 +64,4 @@ ddg_goodie_test( 'url decode online' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/URLEncode.t b/t/URLEncode.t index 38940744b..2e76e9c12 100644 --- a/t/URLEncode.t +++ b/t/URLEncode.t @@ -4,6 +4,7 @@ use strict; use warnings; use utf8; use Test::More; +use Test::Deep; use HTML::Entities; use DDG::Test::Goodie; @@ -52,4 +53,4 @@ ddg_goodie_test( 'hello there escapeurl' => test_zci(build_answer('hello%20there', 'hello there')), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/USPS.t b/t/USPS.t index bf36bce60..6858c7951 100644 --- a/t/USPS.t +++ b/t/USPS.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'usps'; @@ -40,4 +41,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/UltimateAnswer.t b/t/UltimateAnswer.t index 6e48663b9..d4ae98093 100644 --- a/t/UltimateAnswer.t +++ b/t/UltimateAnswer.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "ultimate_answer"; @@ -106,4 +107,4 @@ ddg_goodie_test( 'why?' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Unicode.t b/t/Unicode.t index 9ffb77e90..b4a98da91 100644 --- a/t/Unicode.t +++ b/t/Unicode.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'unicode_conversion'; @@ -47,4 +48,4 @@ ddg_goodie_test( 'utf-15 bullet' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/UnicodeFuzzySearch.t b/t/UnicodeFuzzySearch.t index f778ec541..b372b6315 100644 --- a/t/UnicodeFuzzySearch.t +++ b/t/UnicodeFuzzySearch.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci is_cached => 1; @@ -65,4 +66,4 @@ ROTATED HEAVY BLACK HEART BULLET: \x{2765} (U+2765)", ) ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Unicornify.t b/t/Unicornify.t index 4ad143135..921dd33e3 100644 --- a/t/Unicornify.t +++ b/t/Unicornify.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Unicornify::URL; @@ -37,4 +38,4 @@ ddg_goodie_test( } })); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Unidecode.t b/t/Unidecode.t index 45c3a0945..0a263c615 100644 --- a/t/Unidecode.t +++ b/t/Unidecode.t @@ -3,6 +3,7 @@ use utf8; use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'convert_to_ascii'; @@ -19,4 +20,3 @@ ddg_goodie_test( ); done_testing; - diff --git a/t/UnixPermissions.t b/t/UnixPermissions.t index b5f51028e..f2bea418c 100644 --- a/t/UnixPermissions.t +++ b/t/UnixPermissions.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'unix_permissions'; @@ -97,4 +98,4 @@ Others: read, write and execute 'permission 9644' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/UnixTime.t b/t/UnixTime.t index dfe24379a..e1d8d04f7 100644 --- a/t/UnixTime.t +++ b/t/UnixTime.t @@ -3,12 +3,13 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'time_conversion'; zci is_cached => 0; -my @zero = (qr/Thu Jan 01 00:00:00 1970 UTC/, +my @zero = (re(qr/Thu Jan 01 00:00:00 1970 UTC/), structured_answer => { data => { record_data => { @@ -26,7 +27,7 @@ my @zero = (qr/Thu Jan 01 00:00:00 1970 UTC/, } } ); -my @zeroi = (qr/Thu Jan 01 00:00:00 1970 UTC/, +my @zeroi = (re(qr/Thu Jan 01 00:00:00 1970 UTC/), structured_answer => { data => { record_data => { @@ -45,9 +46,9 @@ my @zeroi = (qr/Thu Jan 01 00:00:00 1970 UTC/, } ); -my @now = (qr/Unix Epoch./, +my @now = (re(qr/Unix Epoch./), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -56,9 +57,9 @@ my @now = (qr/Unix Epoch./, } } ); -my @then = (qr/Tue Nov 18 00:28:30 1930 UTC/, +my @then = (re(qr/Tue Nov 18 00:28:30 1930 UTC/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -67,9 +68,9 @@ my @then = (qr/Tue Nov 18 00:28:30 1930 UTC/, } } ); -my @later = (qr/Tue Jan 19 03:14:07 2038 UTC/, +my @later = (re(qr/Tue Jan 19 03:14:07 2038 UTC/), structured_answer => { - data => '-ANY-', + data => ignore(), templates => { group => 'list', options => { @@ -108,4 +109,4 @@ ddg_goodie_test([qw( 'unix time info' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Uppercase.t b/t/Uppercase.t index 114e04777..750f05f0c 100755 --- a/t/Uppercase.t +++ b/t/Uppercase.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'uppercase'; @@ -33,4 +34,4 @@ ddg_goodie_test( 'uppercase 123' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Uptime.t b/t/Uptime.t index 54fc5f407..a45bc2a18 100644 --- a/t/Uptime.t +++ b/t/Uptime.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "uptime"; @@ -172,4 +173,4 @@ ddg_goodie_test( 'up time 99%%' => undef ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/VIN.t b/t/VIN.t index 7733280d5..f3d9b98b1 100644 --- a/t/VIN.t +++ b/t/VIN.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'vin'; @@ -72,4 +73,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ValarMorghulis.t b/t/ValarMorghulis.t index b36e35436..32db4adbd 100644 --- a/t/ValarMorghulis.t +++ b/t/ValarMorghulis.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'valar_morghulis'; diff --git a/t/Wavelength.t b/t/Wavelength.t index 6c80c045c..71e0674f1 100644 --- a/t/Wavelength.t +++ b/t/Wavelength.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use utf8; @@ -41,4 +42,4 @@ sub mk_test { result => $expect, } ); -} +} \ No newline at end of file diff --git a/t/Week.t b/t/Week.t index a020ab139..b79f49368 100755 --- a/t/Week.t +++ b/t/Week.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -10,11 +11,11 @@ zci answer_type => "week"; zci is_cached => 1; my @current_week = ( - qr/We are currently in the \d{1,2}\w{2} week of \d{4}./, + re(qr/We are currently in the \d{1,2}\w{2} week of \d{4}./), structured_answer => { input => [], operation => 'Assuming the week starts on Monday', - result => qr/We are currently in the \d{1,2}\w{2} week of \d{4}./, + result => re(qr/We are currently in the \d{1,2}\w{2} week of \d{4}./), }); @@ -95,11 +96,11 @@ ddg_goodie_test( ), # Nth Week Queries "what was the 5th week of this year" => test_zci( - qr/The \d{1,2}\w{2} week of \d{4} (begins|began) on January \d{1,2}\w{2}\./, + re(qr/The \d{1,2}\w{2} week of \d{4} (begins|began) on January \d{1,2}\w{2}\./), structured_answer => { input => [], operation => "Assuming the week starts on Monday", - result => qr/The \d{1,2}\w{2} week of \d{4} (begins|began) on January \d{1,2}\w{2}\./, + result => re(qr/The \d{1,2}\w{2} week of \d{4} (begins|began) on January \d{1,2}\w{2}\./), } ) ); diff --git a/t/WeekdaysBetween.t b/t/WeekdaysBetween.t index 12ddca463..38194ca23 100755 --- a/t/WeekdaysBetween.t +++ b/t/WeekdaysBetween.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'weekdays_between'; @@ -130,4 +131,4 @@ ddg_goodie_test( 'Weekdays between 18/17/2013 and 21/23/2015 inclusive' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Weight.t b/t/Weight.t index 82824e090..41c593d22 100644 --- a/t/Weight.t +++ b/t/Weight.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => "weight"; @@ -21,4 +22,4 @@ ddg_goodie_test( 'weight 5' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/WhereAmI.t b/t/WhereAmI.t index ee5d3db0a..8878216eb 100644 --- a/t/WhereAmI.t +++ b/t/WhereAmI.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; zci answer_type => 'where_am_i'; @@ -31,4 +32,4 @@ ddg_goodie_test( 'my location is nowhere!' => undef, ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/WorkdaysBetween.t b/t/WorkdaysBetween.t index 9e077a407..914d83fc6 100755 --- a/t/WorkdaysBetween.t +++ b/t/WorkdaysBetween.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -213,22 +214,22 @@ ddg_goodie_test( DDG::Goodie::WorkdaysBetween )], 'business days between jan 10 and jan 20' => test_zci( - qr"There are [1-9] Workdays between 10 Jan [0-9]{4} and 20 Jan [0-9]{4}\.", + re(qr"There are [1-9] Workdays between 10 Jan [0-9]{4} and 20 Jan [0-9]{4}\."), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Workdays between', - result => qr/[1-9]/, + result => re(qr/[1-9]/), } ), 'business days between january and february' => test_zci( - qr"There are [1-9][0-9] Workdays between 01 Jan [0-9]{4} and 01 Feb [0-9]{4}\.", + re(qr"There are [1-9][0-9] Workdays between 01 Jan [0-9]{4} and 01 Feb [0-9]{4}\."), structured_answer => { - input => '-ANY-', + input => ignore(), operation => 'Workdays between', - result => qr/[1-9][0-9]/, + result => re(qr/[1-9][0-9]/), } ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/ZappBrannigan.t b/t/ZappBrannigan.t index 90c70b034..0895f24c6 100644 --- a/t/ZappBrannigan.t +++ b/t/ZappBrannigan.t @@ -28,4 +28,4 @@ ddg_goodie_test( ), ); -done_testing; +done_testing; \ No newline at end of file diff --git a/t/Zodiac.t b/t/Zodiac.t index a4e5ad8ac..0df9923db 100644 --- a/t/Zodiac.t +++ b/t/Zodiac.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use Test::Deep; use DDG::Test::Goodie; use Test::MockTime qw( :all ); @@ -110,4 +111,4 @@ ddg_goodie_test([ qw( DDG::Goodie::Zodiac ) ], restore_time(); -done_testing; +done_testing; \ No newline at end of file