Update Binary IA to Uppercase. Fix All Test Cases for Uppercase Changes.

master
Chris Wilson 2015-01-09 19:46:54 +11:00
parent 31e95e4fb3
commit 2f11d6cc76
46 changed files with 453 additions and 453 deletions

View File

@ -54,16 +54,16 @@ handle remainder => sub {
if (/^([01]+)(\s+from)?$/) {
# Looks like they gave us some binary, let's turn it into decimal!
@out = ($1, bin2dec($1), "binary", "decimal");
@out = ($1, bin2dec($1), "Binary", "Decimal");
} elsif (s/\s+(in|to|into|as)$//) {
# Looks like they are asking for a conversion to binary
# So, try to figure out what they've got.
# They can either tell us explicitly or we can try to just work it out.
if (/^(?:decimal\s+)?([0-9]+)$/) {
@out = ($1, dec2bin($1), "decimal", "binary");
@out = ($1, dec2bin($1), "Decimal", "Binary");
} elsif (/^(?:hex\s+)?(?:0x|Ox|x)?([0-9a-fA-F]+)$/) {
# Normalize the hex output with lowercase and a prepended '0x'.
@out = ('0x' . lc $1, hex2bin($1), "hex", "binary");
@out = ('0x' . lc $1, hex2bin($1), "Hex", "Binary");
} else {
# We didn't match anything else, so just convert whatever string is left.
@out = ($_, bin($_), "String", "Binary");

16
t/ABC.t
View File

@ -21,7 +21,7 @@ ddg_goodie_test(
qr/(pick|axe) \(random\)/,
structured_answer => {
input => ['pick or axe'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:pick|axe)$/,
}
),
@ -29,7 +29,7 @@ ddg_goodie_test(
qr/(yes|no) \(random\)/,
structured_answer => {
input => ['yes or no'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:yes|no)$/,
}
),
@ -37,7 +37,7 @@ ddg_goodie_test(
qr/(this|that|none) \(random\)/,
structured_answer => {
input => ['this, that or none'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:this|that|none)$/,
}
),
@ -45,7 +45,7 @@ ddg_goodie_test(
qr/(this|that|none) \(random\)/,
structured_answer => {
input => ['this, that or none'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:this|that|none)$/,
}
),
@ -53,7 +53,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => ['heads or tails'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:heads|tails)$/,
}
),
@ -61,7 +61,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => ['heads or tails'],
operation => 'random selection from',
operation => 'Random selection from',
result => qr/^(?:heads|tails)$/,
}
),
@ -69,7 +69,7 @@ ddg_goodie_test(
'duckduckgo (non-random)',
structured_answer => {
input => ['duckduckgo, google, bing or something'],
operation => 'non-random selection from',
operation => 'Non-random selection from',
result => 'duckduckgo',
}
),
@ -77,7 +77,7 @@ ddg_goodie_test(
'DuckDuckGo (non-random)',
structured_answer => {
input => ['Google, DuckDuckGo, Bing or SOMETHING'],
operation => 'non-random selection from',
operation => 'Non-random selection from',
result => 'DuckDuckGo',
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'trifle',
structured_answer => {
input => ['filter'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'trifle',
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'Steven',
structured_answer => {
input => ['events'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'Steven',
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'logarithm',
structured_answer => {
input => ['algorithm'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'logarithm',
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'-ANY-',
structured_answer => {
input => ['favorite'],
operation => 'scrambled letters of',
operation => 'Scrambled letters of',
result => '-ANY-',
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'-ANY-',
structured_answer => {
input => ['Mixing it up'],
operation => 'scrambled letters of',
operation => 'Scrambled letters of',
result => '-ANY-',
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'emits, items, mites, smite',
structured_answer => {
input => ['times'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'emits, items, mites, smite',
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
'Post, opts, post, pots, spot, tops',
structured_answer => {
input => ['stop'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'Post, opts, post, pots, spot, tops',
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
'lots, slot',
structured_answer => {
input => ['lost'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'lots, slot',
}
),
@ -78,13 +78,13 @@ ddg_goodie_test(
'Tom Riddle',
structured_answer => {
input => ['voldemort'],
operation => 'anagrams of',
operation => 'Anagrams of',
result => 'Tom Riddle',
}
),
# No result tests.
'anagram of' => undef,
'anagrams for' => undef,
'Anagrams for' => undef,
'anagrams for ""' => undef,
'anagrams for "867-5309"' => undef,
);

View File

@ -16,7 +16,7 @@ ddg_goodie_test([qw(
'01101010 in binary is "j" in ASCII',
structured_answer => {
input => ['01101010'],
operation => 'binary to ASCII',
operation => 'Binary to ASCII',
result => 'j',
}
),
@ -24,7 +24,7 @@ ddg_goodie_test([qw(
'00111001 in binary is "9" in ASCII',
structured_answer => {
input => ['00111001'],
operation => 'binary to ASCII',
operation => 'Binary to ASCII',
result => '9',
}
),
@ -32,7 +32,7 @@ ddg_goodie_test([qw(
'01110100011010000110100101110011 in binary is "this" in ASCII',
structured_answer => {
input => ['01110100011010000110100101110011'],
operation => 'binary to ASCII',
operation => 'Binary to ASCII',
result => 'this',
}
),
@ -40,7 +40,7 @@ ddg_goodie_test([qw(
'01110100011010000110000101110100 in binary is "that" in ASCII',
structured_answer => {
input => ['01110100011010000110000101110100'],
operation => 'binary to ASCII',
operation => 'Binary to ASCII',
result => 'that',
}
),
@ -48,7 +48,7 @@ ddg_goodie_test([qw(
'0110100001100101011011000110110001101111 in binary is "hello" in ASCII',
structured_answer => {
input => ['0110100001100101011011000110110001101111'],
operation => 'binary to ASCII',
operation => 'Binary to ASCII',
result => 'hello',
}
),

View File

@ -5,7 +5,7 @@ use warnings;
use Test::More;
use DDG::Test::Goodie;
zci answer_type => 'aspect_ratio';
zci answer_type => 'Aspect_ratio';
zci is_cached => 1;
ddg_goodie_test([qw(
@ -16,7 +16,7 @@ ddg_goodie_test([qw(
'Aspect ratio: 640:480 (4:3)',
structured_answer => {
input => ['4:3'],
operation => 'aspect ratio',
operation => 'Aspect ratio',
result => '640:480'
}
),
@ -24,7 +24,7 @@ ddg_goodie_test([qw(
'Aspect ratio: 640:480 (4:3)',
structured_answer => {
input => ['4:3'],
operation => 'aspect ratio',
operation => 'Aspect ratio',
result => '640:480'
}
),
@ -32,7 +32,7 @@ ddg_goodie_test([qw(
'Aspect ratio: 20:30 (1:1.5)',
structured_answer => {
input => ['1:1.5'],
operation => 'aspect ratio',
operation => 'Aspect ratio',
result => '20:30'
}
),
@ -40,7 +40,7 @@ ddg_goodie_test([qw(
'Aspect ratio: 10:15 (1:1.5)',
structured_answer => {
input => ['1:1.5'],
operation => 'aspect ratio',
operation => 'Aspect ratio',
result => '10:15'
}
),

View File

@ -17,7 +17,7 @@ ddg_goodie_test([qw(
'255 in base 16 is FF',
structured_answer => {
input => [255],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => 'FF'
}
),
@ -25,7 +25,7 @@ ddg_goodie_test([qw(
'255 in base 16 is FF',
structured_answer => {
input => [255],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => 'FF'
}
),
@ -33,7 +33,7 @@ ddg_goodie_test([qw(
'255 in base 16 is FF',
structured_answer => {
input => [255],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => 'FF'
}
),
@ -41,7 +41,7 @@ ddg_goodie_test([qw(
'42 in base 2 is 101010',
structured_answer => {
input => [42],
operation => 'decimal to base 2',
operation => 'Decimal to base 2',
result => '101010'
}
),
@ -49,7 +49,7 @@ ddg_goodie_test([qw(
'42 in base 2 is 101010',
structured_answer => {
input => [42],
operation => 'decimal to base 2',
operation => 'Decimal to base 2',
result => "101010",
}
),
@ -57,7 +57,7 @@ ddg_goodie_test([qw(
'42 in base 16 is 2A',
structured_answer => {
input => [42],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => '2A'
}
),
@ -65,7 +65,7 @@ ddg_goodie_test([qw(
'42 in base 8 is 52',
structured_answer => {
input => [42],
operation => 'decimal to base 8',
operation => 'Decimal to base 8',
result => '52'
}
),
@ -73,7 +73,7 @@ ddg_goodie_test([qw(
'10 in base 3 is 101',
structured_answer => {
input => [10],
operation => 'decimal to base 3',
operation => 'Decimal to base 3',
result => '101'
}
),
@ -81,7 +81,7 @@ ddg_goodie_test([qw(
'18442240474082181119 in base 16 is FFEFFFFFFFFFFFFF',
structured_answer => {
input => [18442240474082181119],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => 'FFEFFFFFFFFFFFFF'
}
),
@ -89,7 +89,7 @@ ddg_goodie_test([qw(
'999999999999999999999999 in base 16 is D3C21BCECCEDA0FFFFFF',
structured_answer => {
input => ["999999999999999999999999"],
operation => 'decimal to base 16',
operation => 'Decimal to base 16',
result => 'D3C21BCECCEDA0FFFFFF'
}
),

View File

@ -12,14 +12,14 @@ my @foo = (
'Base64 encoded: Zm9v',
structured_answer => {
input => ['foo'],
operation => 'base64 encode',
operation => 'Base64 encode',
result => 'Zm9v'
});
my @this_text = (
'Base64 decoded: this text',
structured_answer => {
input => ['dGhpcyB0ZXh0'],
operation => 'base64 decode',
operation => 'Base64 decode',
result => 'this text'
});
@ -32,7 +32,7 @@ ddg_goodie_test(
'Base64 encoded: dGhpcyB0ZXh0',
structured_answer => {
input => ['this text'],
operation => 'base64 encode',
operation => 'Base64 encode',
result => 'dGhpcyB0ZXh0'
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'Binary conversion: foo (string) = 011001100110111101101111 (binary)',
structured_answer => {
input => ['foo'],
operation => 'string to binary',
operation => 'String to Binary',
result => '011001100110111101101111'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'Binary conversion: 12 (decimal) = 00001100 (binary)',
structured_answer => {
input => [12],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '00001100'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'Binary conversion: that (string) = 01110100011010000110000101110100 (binary)',
structured_answer => {
input => ['that'],
operation => 'string to binary',
operation => 'String to Binary',
result => '01110100011010000110000101110100'
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'Binary conversion: 127 (decimal) = 01111111 (binary)',
structured_answer => {
input => ['127'],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '01111111'
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'Binary conversion: 256 (decimal) = 0000000100000000 (binary)',
structured_answer => {
input => ['256'],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '0000000100000000'
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'Binary conversion: 0x00 (hex) = 00000000 (binary)',
structured_answer => {
input => ['0x00'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '00000000'
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
'Binary conversion: 0x1e (hex) = 00011110 (binary)',
structured_answer => {
input => ['0x1e'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '00011110'
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
'Binary conversion: 0xa1 (hex) = 10100001 (binary)',
structured_answer => {
input => ['0xa1'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '10100001'
}
),
@ -78,7 +78,7 @@ ddg_goodie_test(
'Binary conversion: 0xffff (hex) = 1111111111111111 (binary)',
structured_answer => {
input => ['0xffff'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '1111111111111111'
}
),
@ -86,7 +86,7 @@ ddg_goodie_test(
'Binary conversion: 0xffff (hex) = 1111111111111111 (binary)',
structured_answer => {
input => ['0xffff'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '1111111111111111'
}
),
@ -94,7 +94,7 @@ ddg_goodie_test(
'Binary conversion: 0xfefe (hex) = 1111111011111110 (binary)',
structured_answer => {
input => ['0xfefe'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '1111111011111110'
}
),
@ -102,7 +102,7 @@ ddg_goodie_test(
'Binary conversion: 10 (binary) = 2 (decimal)',
structured_answer => {
input => ['10'],
operation => 'binary to decimal',
operation => 'Binary to Decimal',
result => '2'
}
),
@ -110,7 +110,7 @@ ddg_goodie_test(
'Binary conversion: 10 (binary) = 2 (decimal)',
structured_answer => {
input => ['10'],
operation => 'binary to decimal',
operation => 'Binary to Decimal',
result => '2'
}
),
@ -118,7 +118,7 @@ ddg_goodie_test(
'Binary conversion: 10 (decimal) = 00001010 (binary)',
structured_answer => {
input => ['10'],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '00001010'
}
),
@ -126,7 +126,7 @@ ddg_goodie_test(
'Binary conversion: 10 (decimal) = 00001010 (binary)',
structured_answer => {
input => ['10'],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '00001010'
}
),
@ -134,7 +134,7 @@ ddg_goodie_test(
'Binary conversion: 0x10 (hex) = 00010000 (binary)',
structured_answer => {
input => ['0x10'],
operation => 'hex to binary',
operation => 'Hex to Binary',
result => '00010000'
}
),
@ -142,7 +142,7 @@ ddg_goodie_test(
'Binary conversion: 0xg (string) = 001100000111100001100111 (binary)',
structured_answer => {
input => ['0xg'],
operation => 'string to binary',
operation => 'String to Binary',
result => '001100000111100001100111'
}
),
@ -150,7 +150,7 @@ ddg_goodie_test(
'Binary conversion: hex 0xg (string) = 01101000011001010111100000100000001100000111100001100111 (binary)',
structured_answer => {
input => ['hex 0xg'],
operation => 'string to binary',
operation => 'String to Binary',
result => '01101000011001010111100000100000001100000111100001100111'
}
),
@ -158,7 +158,7 @@ ddg_goodie_test(
'Binary conversion: 2336462209024 (decimal) = 000000100010000000000000000000000000000000000000 (binary)',
structured_answer => {
input => ['2336462209024'],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '000000100010000000000000000000000000000000000000'
}
),
@ -166,7 +166,7 @@ ddg_goodie_test(
'Binary conversion: 300000000000000 (decimal) = 00000001000100001101100100110001011011101100000000000000 (binary)',
structured_answer => {
input => [300000000000000],
operation => 'decimal to binary',
operation => 'Decimal to Binary',
result => '00000001000100001101100100110001011011101100000000000000'
}
),
@ -174,7 +174,7 @@ ddg_goodie_test(
'Binary conversion: Cygnus X-1 (string) = 01000011011110010110011101101110011101010111001100100000010110000010110100110001 (binary)',
structured_answer => {
input => ['Cygnus X-1'],
operation => 'string to binary',
operation => 'String to Binary',
result => '01000011011110010110011101101110011101010111001100100000010110000010110100110001'
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'April birthstone: Diamond',
structured_answer => {
input => ['April'],
operation => 'birthstone',
operation => 'Birthstone',
result => 'Diamond'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'June birthstone: Pearl',
structured_answer => {
input => ['June'],
operation => 'birthstone',
operation => 'Birthstone',
result => 'Pearl'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'December birthstone: Turquoise',
structured_answer => {
input => ['December'],
operation => 'birthstone',
operation => 'Birthstone',
result => 'Turquoise'
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'April birthstone: Diamond',
structured_answer => {
input => ['April'],
operation => 'birthstone',
operation => 'Birthstone',
result => 'Diamond'
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'May birthstone: Emerald',
structured_answer => {
input => ['May'],
operation => 'birthstone',
operation => 'Birthstone',
result => 'Emerald'
}
),

View File

@ -16,7 +16,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 - 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0</
}
),
@ -25,7 +25,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 + 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>4</
}
),
@ -34,7 +34,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 8'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>256</
}
),
@ -43,7 +43,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 * 7'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>14</
}
),
@ -52,7 +52,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1 dozen * 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>24</
}
),
@ -61,7 +61,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['dozen + dozen'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>24</
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 divided by 4'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0.5</
}
),
@ -79,7 +79,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>4</
}
),
@ -88,7 +88,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 0.2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.14869835499704</
}
),
@ -97,7 +97,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['cos(0)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</
}
),
@ -106,7 +106,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['tan(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.5574077246549</
}
),
@ -115,7 +115,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['tanh(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0\.761594155955765</
}
),
@ -124,7 +124,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['cotan(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0\.642092615934331</
}
),
@ -133,7 +133,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['sin(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0\.841470984807897</
}
),
@ -142,7 +142,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['csc(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.18839510577812</
}
),
@ -151,7 +151,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['sec(1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.85081571768093</
}
),
@ -160,7 +160,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log(3)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.09861228866811</
}
),
@ -169,7 +169,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log(3)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.09861228866811</
}
),
@ -178,7 +178,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log10(100.00)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2</
}
),
@ -187,7 +187,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log_10(100.00)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2</
}
),
@ -196,7 +196,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log_2(16)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>4</
}
),
@ -205,7 +205,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log_23(25)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.0265928122321</
}
),
@ -214,7 +214,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['log23(25)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1\.0265928122321</
}
),
@ -223,7 +223,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['$3.43 + $34.45'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>\$37\.88</
}
),
@ -232,7 +232,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['$3.45 + $34.45'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>\$37\.90</
}
),
@ -241,7 +241,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['$3 + $34'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>\$37\.00</
}
),
@ -250,7 +250,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['$3,4 + $34,4'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>\$37,80</
}
),
@ -259,7 +259,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['64 * 343'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>21,952</
}
),
@ -268,7 +268,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(1 * 10 ^ 2) + 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>101</
}
),
@ -277,7 +277,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1 + (1 * 10 ^ 2)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>101</
}
),
@ -286,7 +286,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 * 3 + (1 * 10 ^ 2)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>106</
}
),
@ -295,7 +295,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(1 * 10 ^ 2) + 2 * 3'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>106</
}
),
@ -304,7 +304,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(1 * 10 ^ 2) / 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>50</
}
),
@ -313,7 +313,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 / (1 * 10 ^ 2)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0\.02</
}
),
@ -322,7 +322,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['424334 + 2253828'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2,678,162</
}
),
@ -331,7 +331,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['4.243,34 + 22.538,28'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>26\.781,62</
}
),
@ -340,7 +340,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['sin(1,0) + 1,05'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1,8914709848079</
}
),
@ -349,7 +349,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['21 + 15 * 0 + 5'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>26</
}
),
@ -358,7 +358,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['0.8158 - 0.8157'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0\.0001</
}
),
@ -367,7 +367,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2,90 + 4,6'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>7,50</
}
),
@ -376,7 +376,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2,90 + sec(4,6)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>-6,01642861135959</
}
),
@ -385,7 +385,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['100 - 96.54'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>3\.46</
}
),
@ -394,7 +394,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1. + 1.'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2</
}
),
@ -403,7 +403,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1 + sin(pi)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</
}
),
@ -412,7 +412,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1 - 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0</
}
),
@ -421,7 +421,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['sin(pi / 2)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</
}
),
@ -430,7 +430,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['sin(pi)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0</
}
),
@ -439,7 +439,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['cos(2 pi)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</
}
),
@ -448,7 +448,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['5 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>25</
}
),
@ -457,7 +457,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1.0 + 5 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>26</
}
),
@ -466,7 +466,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['3 ^ 2 + 4 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>25</
}
),
@ -475,7 +475,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2,2 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>4,84</
}
),
@ -484,7 +484,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['0.8 ^ 2 + 0.6 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</,
}
),
@ -493,7 +493,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 2 ^ 3'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>256</
}
),
@ -502,7 +502,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 2 ^ 3.06'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>323\.972172143725</
}
),
@ -511,7 +511,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['2 ^ 3 ^ 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>512</
}
),
@ -520,7 +520,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['4 score + 7'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>87</
}
),
@ -529,7 +529,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['418.1 / 2'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>209\.05</
}
),
@ -538,7 +538,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['418.005 / 8'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>52\.250625</
}
),
@ -547,7 +547,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(pi ^ 4 + pi ^ 5) ^ (1 / 6)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2\.71828180861191</
}
),
@ -556,7 +556,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(pi ^ 4 + pi ^ 5) ^ (1 / 6) + 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>3\.71828180861191</
}
),
@ -565,7 +565,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['5 ^ 4 ^ (3 - 2) ^ 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>625</
}
),
@ -574,7 +574,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(5 - 4) ^ (3 - 2) ^ 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>1</
}
),
@ -583,7 +583,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(5 + 4 - 3) ^ (2 - 1)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>6</
}
),
@ -592,7 +592,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['5 ^ ((4 - 3) * (2 + 1)) + 6'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>131</
}
),
@ -601,7 +601,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['20 * 07'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>140</
}
),
@ -610,7 +610,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['83.166.167.160 / 33'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>2\.520\.186\.883,63636</
}
),
@ -619,7 +619,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['123.123.123.123 / 255.255.255.256'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>0,482352941174581</
}
),
@ -628,7 +628,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(4 * 10 ^ 5) + 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>400,001</
}
),
@ -637,7 +637,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['(4 * 10 ^ 5) + 1'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>400,001</
}
),
@ -646,7 +646,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['pi / (1 * 10 ^ 9)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>3\.14159265358979 \* 10<sup>-9<\/sup></
}
),
@ -655,7 +655,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['pi * (1 * 10 ^ 9)'],
operation => 'calculate',
operation => 'Calculate',
result => qr/>3,141,592,653\.58979</
}
),
@ -664,7 +664,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1234 + 5432'],
operation => 'calculate',
operation => 'Calculate',
result => qr/6,666/
}
),
@ -673,7 +673,7 @@ ddg_goodie_test(
heading => 'Calculator',
structured_answer => {
input => ['1234 + 5432'],
operation => 'calculate',
operation => 'Calculate',
result => qr/6,666/
}
),

View File

@ -12,7 +12,7 @@ my @g22h = (
'22 August 2003 (Gregorian) is 23 Jumaada Thani 1424 (Hijri)',
structured_answer => {
input => ['22 August 2003 (Gregorian)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '23 Jumaada Thani 1424 (Hijri)'
},
);
@ -20,7 +20,7 @@ my @h23g = (
'23 Jumaada Thani 1424 (Hijri) is 22 August 2003 (Gregorian)',
structured_answer => {
input => ['23 Jumaada Thani 1424 (Hijri)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '22 August 2003 (Gregorian)'
},
);
@ -28,7 +28,7 @@ my @g22j = (
'22 August 2003 (Gregorian) is 31 Mordad 1382 (Jalali)',
structured_answer => {
input => ['22 August 2003 (Gregorian)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '31 Mordad 1382 (Jalali)'
},
);
@ -45,7 +45,7 @@ ddg_goodie_test(
'31 Mordad 1382 (Jalali) is 22 August 2003 (Gregorian)',
structured_answer => {
input => ['31 Mordad 1382 (Jalali)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '22 August 2003 (Gregorian)'
},
),
@ -53,7 +53,7 @@ ddg_goodie_test(
'31 Mordad 1382 (Jalali) is 23 Jumaada Thani 1424 (Hijri)',
structured_answer => {
input => ['31 Mordad 1382 (Jalali)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '23 Jumaada Thani 1424 (Hijri)'
},
),
@ -61,7 +61,7 @@ ddg_goodie_test(
'23 Jumaada Thani 1424 (Hijri) is 31 Mordad 1382 (Jalali)',
structured_answer => {
input => ['23 Jumaada Thani 1424 (Hijri)'],
operation => 'calendar conversion',
operation => 'Calendar conversion',
result => '31 Mordad 1382 (Jalali)',
},
),

View File

@ -18,7 +18,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -26,7 +26,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['Brazil'],
operation => 'international calling code',
operation => 'International calling code',
result => '+55'
}
),
@ -34,7 +34,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -42,7 +42,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -51,7 +51,7 @@ ddg_goodie_test(
"+249 $txt Sudan.",
structured_answer => {
input => ['Sudan'],
operation => 'international calling code',
operation => 'International calling code',
result => '+249'
}
),
@ -59,7 +59,7 @@ ddg_goodie_test(
"+379 $txt the Holy See (Vatican City State).",
structured_answer => {
input => ['the Holy See (Vatican City State)'],
operation => 'international calling code',
operation => 'International calling code',
result => '+379'
}
),
@ -67,7 +67,7 @@ ddg_goodie_test(
"+379 $txt the Holy See (Vatican City State).",
structured_answer => {
input => ['+379'],
operation => 'international calling code',
operation => 'International calling code',
result => 'the Holy See (Vatican City State)'
}
),
@ -75,7 +75,7 @@ ddg_goodie_test(
"+379 $txt the Holy See (Vatican City State).",
structured_answer => {
input => ['the Holy See (Vatican City State)'],
operation => 'international calling code',
operation => 'International calling code',
result => '+379'
}
),
@ -83,7 +83,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['Brazil'],
operation => 'international calling code',
operation => 'International calling code',
result => '+55'
}
),
@ -91,7 +91,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -99,7 +99,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['Brazil'],
operation => 'international calling code',
operation => 'International calling code',
result => '+55'
}
),
@ -107,7 +107,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -115,7 +115,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['Brazil'],
operation => 'international calling code',
operation => 'International calling code',
result => '+55'
}
),
@ -123,7 +123,7 @@ ddg_goodie_test(
"+55 $txt Brazil.",
structured_answer => {
input => ['+55'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Brazil'
}
),
@ -131,7 +131,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['+65'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Singapore'
}
),
@ -139,7 +139,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['+65'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Singapore'
}
),
@ -147,7 +147,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['+65'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Singapore'
}
),
@ -155,7 +155,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['+65'],
operation => 'international calling code',
operation => 'International calling code',
result => 'Singapore'
}
),
@ -163,7 +163,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['Singapore'],
operation => 'international calling code',
operation => 'International calling code',
result => '+65'
}
),
@ -171,7 +171,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['Singapore'],
operation => 'international calling code',
operation => 'International calling code',
result => '+65'
}
),
@ -179,7 +179,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['Singapore'],
operation => 'international calling code',
operation => 'International calling code',
result => '+65'
}
),
@ -187,7 +187,7 @@ ddg_goodie_test(
"+65 $txt Singapore.",
structured_answer => {
input => ['Singapore'],
operation => 'international calling code',
operation => 'International calling code',
result => '+65'
}
),
@ -195,7 +195,7 @@ ddg_goodie_test(
"+44 $txt the United Kingdom.",
structured_answer => {
input => ['the United Kingdom'],
operation => 'international calling code',
operation => 'International calling code',
result => '+44'
}
),
@ -203,7 +203,7 @@ ddg_goodie_test(
"+44 $txt the United Kingdom.",
structured_answer => {
input => ['the United Kingdom'],
operation => 'international calling code',
operation => 'International calling code',
result => '+44'
}
),
@ -211,7 +211,7 @@ ddg_goodie_test(
"+44 $txt the United Kingdom.",
structured_answer => {
input => ['the United Kingdom'],
operation => 'international calling code',
operation => 'International calling code',
result => '+44'
}
),
@ -219,7 +219,7 @@ ddg_goodie_test(
"+44 $txt the United Kingdom.",
structured_answer => {
input => ['the United Kingdom'],
operation => 'international calling code',
operation => 'International calling code',
result => '+44'
}
),
@ -227,7 +227,7 @@ ddg_goodie_test(
"+1 $txt Antigua and Barbuda.",
structured_answer => {
input => ['Antigua and Barbuda'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -235,7 +235,7 @@ ddg_goodie_test(
"+1 $txt Antigua and Barbuda.",
structured_answer => {
input => ['Antigua and Barbuda'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -243,7 +243,7 @@ ddg_goodie_test(
"+1 $txt Trinidad and Tobago.",
structured_answer => {
input => ['Trinidad and Tobago'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -251,7 +251,7 @@ ddg_goodie_test(
"+1 $txt Trinidad and Tobago.",
structured_answer => {
input => ['Trinidad and Tobago'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -259,7 +259,7 @@ ddg_goodie_test(
"+1 $txt the United States.",
structured_answer => {
input => ['the United States'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -267,7 +267,7 @@ ddg_goodie_test(
"+1 $txt the United States.",
structured_answer => {
input => ['the United States'],
operation => 'international calling code',
operation => 'International calling code',
result => '+1'
}
),
@ -275,7 +275,7 @@ ddg_goodie_test(
"+1 $txt Antigua and Barbuda, Anguilla, American Samoa, Barbados, Bermuda, the Bahamas, Canada, Dominica, the Dominican Republic, Grenada, Guam, Jamaica, Saint Lucia, Saint Kitts and Nevis, the Cayman Islands, the Northern Mariana Islands, Montserrat, Puerto Rico, Turks and Caicos Islands, Trinidad and Tobago, the United States, Saint Vincent and the Grenadines, the British Virgin Islands, and the US Virgin Islands.",
structured_answer => {
input => ['+1'],
operation => 'international calling code',
operation => 'International calling code',
result => qr/^Antigua.* US Virgin Islands$/,
}
),
@ -283,7 +283,7 @@ ddg_goodie_test(
"+7 $txt the Russian Federation and Kazakhstan.",
structured_answer => {
input => ['+7'],
operation => 'international calling code',
operation => 'International calling code',
result => 'the Russian Federation and Kazakhstan'
}
),
@ -291,7 +291,7 @@ ddg_goodie_test(
"+7 $txt the Russian Federation.",
structured_answer => {
input => ['the Russian Federation'],
operation => 'international calling code',
operation => 'International calling code',
result => '+7'
}
),
@ -299,7 +299,7 @@ ddg_goodie_test(
"+7 $txt the Russian Federation.",
structured_answer => {
input => ['the Russian Federation'],
operation => 'international calling code',
operation => 'International calling code',
result => '+7'
}
),
@ -307,7 +307,7 @@ ddg_goodie_test(
"+82 $txt the Republic of Korea.",
structured_answer => {
input => ['the Republic of Korea'],
operation => 'international calling code',
operation => 'International calling code',
result => '+82'
}
),
@ -315,7 +315,7 @@ ddg_goodie_test(
"+82 $txt the Republic of Korea.",
structured_answer => {
input => ['the Republic of Korea'],
operation => 'international calling code',
operation => 'International calling code',
result => '+82'
}
),
@ -323,7 +323,7 @@ ddg_goodie_test(
"+850 $txt the Democratic People's Republic of Korea.",
structured_answer => {
input => ['the Democratic People\'s Republic of Korea'],
operation => 'international calling code',
operation => 'International calling code',
result => '+850'
}
),
@ -331,7 +331,7 @@ ddg_goodie_test(
"+850 $txt the Democratic People's Republic of Korea.",
structured_answer => {
input => ['the Democratic People\'s Republic of Korea'],
operation => 'international calling code',
operation => 'International calling code',
result => '+850'
}
),

View File

@ -12,7 +12,7 @@ my @my_string = (
'"my string" is 9 characters long.',
structured_answer => {
input => ['my string'],
operation => 'character count',
operation => 'Character count',
result => 9
});
@ -39,7 +39,7 @@ ddg_goodie_test(
'"1" is 1 character long.',
structured_answer => {
input => ['1'],
operation => 'character count',
operation => 'Character count',
result => 1
}
),
@ -49,7 +49,7 @@ ddg_goodie_test(
'"" is 0 characters long.',
structured_answer => {
input => [''],
operation => 'character count',
operation => 'Character count',
result => 0
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
qr/(heads|tails), (heads|tails) \(random\)/,
structured_answer => {
input => [2],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/(heads|tails), /
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
qr/(heads|tails), (heads|tails) \(random\)/,
structured_answer => {
input => [2],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/(heads|tails), /
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
qr/(heads|tails) \(random\)/,
structured_answer => {
input => [1],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/^(heads|tails)$/
}
),
@ -78,7 +78,7 @@ ddg_goodie_test(
qr/((heads|tails),? ){4}\(random\)/,
structured_answer => {
input => [4],
operation => 'flip coin',
operation => 'Flip coin',
result => qr/(heads|tails),? /
}
),

View File

@ -16,7 +16,7 @@ ddg_goodie_test(
'5 ounces = 141.747 grams',
structured_answer => {
input => ['5 ounces'],
operation => 'convert',
operation => 'Convert',
result => '141.747 grams'
}
),
@ -24,7 +24,7 @@ ddg_goodie_test(
'5 ounces = 141.747 grams',
structured_answer => {
input => ['5 ounces'],
operation => 'convert',
operation => 'Convert',
result => '141.747 grams'
}
),
@ -32,7 +32,7 @@ ddg_goodie_test(
'0.5 nautical miles = 0.926 kilometers',
structured_answer => {
input => ['0.5 nautical miles'],
operation => 'convert',
operation => 'Convert',
result => '0.926 kilometers'
}
),
@ -41,7 +41,7 @@ ddg_goodie_test(
'1 ton = 0.893 long tons',
structured_answer => {
input => ['1 ton'],
operation => 'convert',
operation => 'Convert',
result => '0.893 long tons'
}
),
@ -49,7 +49,7 @@ ddg_goodie_test(
'158 ounces = 9.875 pounds',
structured_answer => {
input => ['158 ounces'],
operation => 'convert',
operation => 'Convert',
result => '9.875 pounds'
}
),
@ -57,7 +57,7 @@ ddg_goodie_test(
'0.111 stone = 1.554 pounds',
structured_answer => {
input => ['0.111 stone'],
operation => 'convert',
operation => 'Convert',
result => '1.554 pounds'
}
),
@ -65,7 +65,7 @@ ddg_goodie_test(
'5 feet = 60 inches',
structured_answer => {
input => ['5 feet'],
operation => 'convert',
operation => 'Convert',
result => '60 inches'
}
),
@ -73,7 +73,7 @@ ddg_goodie_test(
'5 kelvin = -450.670 degrees fahrenheit',
structured_answer => {
input => ['5 kelvin'],
operation => 'convert',
operation => 'Convert',
result => '-450.670 degrees fahrenheit'
}
),
@ -81,7 +81,7 @@ ddg_goodie_test(
'25 inches = 2.083 feet',
structured_answer => {
input => ['25 inches'],
operation => 'convert',
operation => 'Convert',
result => '2.083 feet'
}
),
@ -89,7 +89,7 @@ ddg_goodie_test(
'5 degrees fahrenheit = -15 degrees celsius',
structured_answer => {
input => ['5 degrees fahrenheit'],
operation => 'convert',
operation => 'Convert',
result => '-15 degrees celsius'
}
),
@ -97,7 +97,7 @@ ddg_goodie_test(
'1 kilometer = 100,000 centimeters',
structured_answer => {
input => ['1 kilometer'],
operation => 'convert',
operation => 'Convert',
result => '100,000 centimeters'
}
),
@ -105,7 +105,7 @@ ddg_goodie_test(
'10 milliseconds = 0.010 seconds',
structured_answer => {
input => ['10 milliseconds'],
operation => 'convert',
operation => 'Convert',
result => '0.010 seconds'
}
),
@ -113,7 +113,7 @@ ddg_goodie_test(
'1 yottabyte = 0.827 yobibytes',
structured_answer => {
input => ['1 yottabyte'],
operation => 'convert',
operation => 'Convert',
result => '0.827 yobibytes'
}
),
@ -121,7 +121,7 @@ ddg_goodie_test(
'1 stone = 14 pounds',
structured_answer => {
input => ['1 stone'],
operation => 'convert',
operation => 'Convert',
result => '14 pounds'
}
),
@ -129,7 +129,7 @@ ddg_goodie_test(
'5 bytes = 40 bits',
structured_answer => {
input => ['5 bytes'],
operation => 'convert',
operation => 'Convert',
result => '40 bits'
}
),
@ -138,7 +138,7 @@ ddg_goodie_test(
'3 kilograms = 6.614 pounds',
structured_answer => {
input => ['3 kilograms'],
operation => 'convert',
operation => 'Convert',
result => '6.614 pounds'
}
),
@ -146,7 +146,7 @@ ddg_goodie_test(
'1.3 metric tons = 1.433 tons',
structured_answer => {
input => ['1.3 metric tons'],
operation => 'convert',
operation => 'Convert',
result => '1.433 tons'
}
),
@ -154,7 +154,7 @@ ddg_goodie_test(
'2 tons = 1,814.372 kilograms',
structured_answer => {
input => ['2 tons'],
operation => 'convert',
operation => 'Convert',
result => '1,814.372 kilograms'
}
),
@ -162,7 +162,7 @@ ddg_goodie_test(
'1 ton = 907.186 kilograms',
structured_answer => {
input => ['1 ton'],
operation => 'convert',
operation => 'Convert',
result => '907.186 kilograms'
}
),
@ -170,7 +170,7 @@ ddg_goodie_test(
'3.9 ounces = 110.563 grams',
structured_answer => {
input => ['3.9 ounces'],
operation => 'convert',
operation => 'Convert',
result => '110.563 grams'
}
),
@ -178,7 +178,7 @@ ddg_goodie_test(
'2 miles = 3.219 kilometers',
structured_answer => {
input => ['2 miles'],
operation => 'convert',
operation => 'Convert',
result => '3.219 kilometers'
}
),
@ -186,7 +186,7 @@ ddg_goodie_test(
'0.5 nautical miles = 0.926 kilometers',
structured_answer => {
input => ['0.5 nautical miles'],
operation => 'convert',
operation => 'Convert',
result => '0.926 kilometers'
}
),
@ -194,7 +194,7 @@ ddg_goodie_test(
'500 miles = 804,672.249 meters',
structured_answer => {
input => ['500 miles'],
operation => 'convert',
operation => 'Convert',
result => '804,672.249 meters'
}
),
@ -202,7 +202,7 @@ ddg_goodie_test(
'25 centimeters = 9.843 inches',
structured_answer => {
input => ['25 centimeters'],
operation => 'convert',
operation => 'Convert',
result => '9.843 inches'
}
),
@ -210,7 +210,7 @@ ddg_goodie_test(
'1,760 yards = 1 mile',
structured_answer => {
input => ['1,760 yards'],
operation => 'convert',
operation => 'Convert',
result => '1 mile'
}
),
@ -218,7 +218,7 @@ ddg_goodie_test(
'3,520 yards = 2 miles',
structured_answer => {
input => ['3,520 yards'],
operation => 'convert',
operation => 'Convert',
result => '2 miles'
}
),
@ -226,7 +226,7 @@ ddg_goodie_test(
'30 centimeters = 11.811 inches',
structured_answer => {
input => ['30 centimeters'],
operation => 'convert',
operation => 'Convert',
result => '11.811 inches'
}
),
@ -234,7 +234,7 @@ ddg_goodie_test(
'36 months = 3 years',
structured_answer => {
input => ['36 months'],
operation => 'convert',
operation => 'Convert',
result => '3 years'
}
),
@ -242,7 +242,7 @@ ddg_goodie_test(
'43,200 seconds = 12 hours',
structured_answer => {
input => ['43,200 seconds'],
operation => 'convert',
operation => 'Convert',
result => '12 hours'
}
),
@ -250,7 +250,7 @@ ddg_goodie_test(
'4 hours = 240 minutes',
structured_answer => {
input => ['4 hours'],
operation => 'convert',
operation => 'Convert',
result => '240 minutes'
}
),
@ -258,7 +258,7 @@ ddg_goodie_test(
'1 bar = 100,000 pascals',
structured_answer => {
input => ['1 bar'],
operation => 'convert',
operation => 'Convert',
result => '100,000 pascals'
}
),
@ -266,7 +266,7 @@ ddg_goodie_test(
'1 kilopascal = 0.145 pounds per square inch',
structured_answer => {
input => ['1 kilopascal'],
operation => 'convert',
operation => 'Convert',
result => '0.145 pounds per square inch'
}
),
@ -274,7 +274,7 @@ ddg_goodie_test(
'1 atmosphere = 101.325 kilopascals',
structured_answer => {
input => ['1 atmosphere'],
operation => 'convert',
operation => 'Convert',
result => '101.325 kilopascals'
}
),
@ -282,7 +282,7 @@ ddg_goodie_test(
'5 yards = 0.005 kilometers',
structured_answer => {
input => ['5 yards'],
operation => 'convert',
operation => 'Convert',
result => '0.005 kilometers'
}
),
@ -290,7 +290,7 @@ ddg_goodie_test(
'12 inches = 30.480 centimeters',
structured_answer => {
input => ['12 inches'],
operation => 'convert',
operation => 'Convert',
result => '30.480 centimeters'
}
),
@ -298,7 +298,7 @@ ddg_goodie_test(
'42 kilowatt-hours = 1.51 * 10^8 joules',
structured_answer => {
input => ['42 kilowatt-hours'],
operation => 'convert',
operation => 'Convert',
result => '1.51 * 10<sup>8</sup> joules'
}
),
@ -306,7 +306,7 @@ ddg_goodie_test(
'2,500 large calories = 0.003 tons of TNT',
structured_answer => {
input => ['2,500 large calories'],
operation => 'convert',
operation => 'Convert',
result => '0.003 tons of TNT'
}
),
@ -314,7 +314,7 @@ ddg_goodie_test(
'90 metric horsepower = 66,194.888 watts',
structured_answer => {
input => ['90 metric horsepower'],
operation => 'convert',
operation => 'Convert',
result => '66,194.888 watts'
}
),
@ -322,7 +322,7 @@ ddg_goodie_test(
'1 gigawatt = 1.34 * 10^6 horsepower',
structured_answer => {
input => ['1 gigawatt'],
operation => 'convert',
operation => 'Convert',
result => '1.34 * 10<sup>6</sup> horsepower'
}
),
@ -330,7 +330,7 @@ ddg_goodie_test(
'180 degrees = 3.142 radians',
structured_answer => {
input => ['180 degrees'],
operation => 'convert',
operation => 'Convert',
result => '3.142 radians'
}
),
@ -338,7 +338,7 @@ ddg_goodie_test(
'270 degrees = 3 quadrants',
structured_answer => {
input => ['270 degrees'],
operation => 'convert',
operation => 'Convert',
result => '3 quadrants'
}
),
@ -346,7 +346,7 @@ ddg_goodie_test(
'180 degrees = 200 gradians',
structured_answer => {
input => ['180 degrees'],
operation => 'convert',
operation => 'Convert',
result => '200 gradians'
}
),
@ -354,7 +354,7 @@ ddg_goodie_test(
'45 newtons = 10.116 pounds force',
structured_answer => {
input => ['45 newtons'],
operation => 'convert',
operation => 'Convert',
result => '10.116 pounds force'
}
),
@ -362,7 +362,7 @@ ddg_goodie_test(
'8 poundals = 1.106 newtons',
structured_answer => {
input => ['8 poundals'],
operation => 'convert',
operation => 'Convert',
result => '1.106 newtons'
}
),
@ -370,7 +370,7 @@ ddg_goodie_test(
'10 milligrams = 1.1 * 10^-8 tons',
structured_answer => {
input => ['10 milligrams'],
operation => 'convert',
operation => 'Convert',
result => '1.1 * 10<sup>-8</sup> tons'
}
),
@ -378,7 +378,7 @@ ddg_goodie_test(
'10,000 minutes = 6 * 10^11 microseconds',
structured_answer => {
input => ['10,000 minutes'],
operation => 'convert',
operation => 'Convert',
result => '6 * 10<sup>11</sup> microseconds'
}
),
@ -386,7 +386,7 @@ ddg_goodie_test(
'5 gigabytes = 5,000 megabytes',
structured_answer => {
input => ['5 gigabytes'],
operation => 'convert',
operation => 'Convert',
result => '5,000 megabytes'
}
),
@ -394,7 +394,7 @@ ddg_goodie_test(
'0.013 megabytes = 104,000 bits',
structured_answer => {
input => ['0.013 megabytes'],
operation => 'convert',
operation => 'Convert',
result => '104,000 bits'
}
),
@ -402,7 +402,7 @@ ddg_goodie_test(
'0,013 megabytes = 104.000 bits',
structured_answer => {
input => ['0,013 megabytes'],
operation => 'convert',
operation => 'Convert',
result => '104.000 bits'
}
),
@ -410,7 +410,7 @@ ddg_goodie_test(
'1 exabyte = 888.178 pebibytes',
structured_answer => {
input => ['1 exabyte'],
operation => 'convert',
operation => 'Convert',
result => '888.178 pebibytes'
}
),
@ -418,7 +418,7 @@ ddg_goodie_test(
'16 years = 192 months',
structured_answer => {
input => ['16 years'],
operation => 'convert',
operation => 'Convert',
result => '192 months'
}
),
@ -426,7 +426,7 @@ ddg_goodie_test(
'1 year = 12 months',
structured_answer => {
input => ['1 year'],
operation => 'convert',
operation => 'Convert',
result => '12 months'
}
),
@ -434,7 +434,7 @@ ddg_goodie_test(
'360 degrees = 1 revolution',
structured_answer => {
input => ['360 degrees'],
operation => 'convert',
operation => 'Convert',
result => '1 revolution'
}
),
@ -442,7 +442,7 @@ ddg_goodie_test(
'12 degrees celsius = 53.600 degrees fahrenheit',
structured_answer => {
input => ['12 degrees celsius'],
operation => 'convert',
operation => 'Convert',
result => '53.600 degrees fahrenheit'
}
),
@ -450,7 +450,7 @@ ddg_goodie_test(
'1 degree fahrenheit = -17.222 degrees celsius',
structured_answer => {
input => ['1 degree fahrenheit'],
operation => 'convert',
operation => 'Convert',
result => '-17.222 degrees celsius'
}
),
@ -458,7 +458,7 @@ ddg_goodie_test(
'0 degrees celsius = 273.150 kelvin',
structured_answer => {
input => ['0 degrees celsius'],
operation => 'convert',
operation => 'Convert',
result => '273.150 kelvin'
}
),
@ -466,7 +466,7 @@ ddg_goodie_test(
'234 degrees fahrenheit = 112.222 degrees celsius',
structured_answer => {
input => ['234 degrees fahrenheit'],
operation => 'convert',
operation => 'Convert',
result => '112.222 degrees celsius'
}
),
@ -474,7 +474,7 @@ ddg_goodie_test(
'234 degrees fahrenheit = 385.372 kelvin',
structured_answer => {
input => ['234 degrees fahrenheit'],
operation => 'convert',
operation => 'Convert',
result => '385.372 kelvin'
}
),
@ -482,7 +482,7 @@ ddg_goodie_test(
'20 yards = 18.288 meters',
structured_answer => {
input => ['20 yards'],
operation => 'convert',
operation => 'Convert',
result => '18.288 meters'
}
),
@ -490,7 +490,7 @@ ddg_goodie_test(
'7 milligrams = 7,000 micrograms',
structured_answer => {
input => ['7 milligrams'],
operation => 'convert',
operation => 'Convert',
result => '7,000 micrograms'
}
),
@ -498,7 +498,7 @@ ddg_goodie_test(
'5 meters = 196.851 inches',
structured_answer => {
input => ['5 meters'],
operation => 'convert',
operation => 'Convert',
result => '196.851 inches'
}
),
@ -506,7 +506,7 @@ ddg_goodie_test(
'5 inches = 0.127 meters',
structured_answer => {
input => ['5 inches'],
operation => 'convert',
operation => 'Convert',
result => '0.127 meters'
}
),
@ -514,7 +514,7 @@ ddg_goodie_test(
'1 us gallon = 3,785.412 millilitres',
structured_answer => {
input => ['1 us gallon'],
operation => 'convert',
operation => 'Convert',
result => '3,785.412 millilitres'
}
),
@ -522,7 +522,7 @@ ddg_goodie_test(
'1 millilitre = 0.000264 us gallons',
structured_answer => {
input => ['1 millilitre'],
operation => 'convert',
operation => 'Convert',
result => '0.000264 us gallons'
}
),
@ -530,7 +530,7 @@ ddg_goodie_test(
'1 inch = 0.083 feet',
structured_answer => {
input => ['1 inch'],
operation => 'convert',
operation => 'Convert',
result => '0.083 feet'
}
),
@ -538,7 +538,7 @@ ddg_goodie_test(
'1 millilitre = 0.000264 us gallons',
structured_answer => {
input => ['1 millilitre'],
operation => 'convert',
operation => 'Convert',
result => '0.000264 us gallons'
}
),
@ -546,7 +546,7 @@ ddg_goodie_test(
'1 us gallon = 3,785.412 millilitres',
structured_answer => {
input => ['1 us gallon'],
operation => 'convert',
operation => 'Convert',
result => '3,785.412 millilitres'
}
),
@ -554,7 +554,7 @@ ddg_goodie_test(
'1 millimeter = 0.039 inches',
structured_answer => {
input => ['1 millimeter'],
operation => 'convert',
operation => 'Convert',
result => '0.039 inches'
}
),
@ -562,7 +562,7 @@ ddg_goodie_test(
'1 inch = 25.400 millimeters',
structured_answer => {
input => ['1 inch'],
operation => 'convert',
operation => 'Convert',
result => '25.400 millimeters'
}
),
@ -571,7 +571,7 @@ ddg_goodie_test(
'3 * 10^60 degrees = 8.33 * 10^57 revolutions',
structured_answer => {
input => ['3 * 10<sup>60</sup> degrees'],
operation => 'convert',
operation => 'Convert',
result => '8.33 * 10<sup>57</sup> revolutions'
}
),
@ -579,7 +579,7 @@ ddg_goodie_test(
'4,1 * 10^5 newtons = 92.171,667 pounds force',
structured_answer => {
input => ['4,1 * 10<sup>5</sup> newtons'],
operation => 'convert',
operation => 'Convert',
result => '92.171,667 pounds force'
}
),
@ -587,7 +587,7 @@ ddg_goodie_test(
'4 * 10^5 newtons = 89,923.577 pounds force',
structured_answer => {
input => ['4 * 10<sup>5</sup> newtons'],
operation => 'convert',
operation => 'Convert',
result => '89,923.577 pounds force'
}
),
@ -595,7 +595,7 @@ ddg_goodie_test(
'5,0 gigabytes = 5.000 megabytes',
structured_answer => {
input => ['5,0 gigabytes'],
operation => 'convert',
operation => 'Convert',
result => '5.000 megabytes'
}
),
@ -603,7 +603,7 @@ ddg_goodie_test(
'3.5 * 10^-2 miles = 2,217.602 inches',
structured_answer => {
input => ['3.5 * 10<sup>-2</sup> miles'],
operation => 'convert',
operation => 'Convert',
result => '2,217.602 inches'
}
),
@ -612,7 +612,7 @@ ddg_goodie_test(
'100 square meters = 0.010 hectares',
structured_answer => {
input => ['100 square meters'],
operation => 'convert',
operation => 'Convert',
result => '0.010 hectares'
}
),
@ -620,7 +620,7 @@ ddg_goodie_test(
'0.0001 hectares = 1 square meter',
structured_answer => {
input => ['0.0001 hectares'],
operation => 'convert',
operation => 'Convert',
result => '1 square meter'
}
),
@ -628,7 +628,7 @@ ddg_goodie_test(
'1 imperial gallon = 4.546 litres',
structured_answer => {
input => ['1 imperial gallon'],
operation => 'convert',
operation => 'Convert',
result => '4.546 litres'
}
),
@ -636,7 +636,7 @@ ddg_goodie_test(
'0.001 litres = 1 millilitre',
structured_answer => {
input => ['0.001 litres'],
operation => 'convert',
operation => 'Convert',
result => '1 millilitre'
}
),
@ -644,7 +644,7 @@ ddg_goodie_test(
'1 hectare = 10,000 square meters',
structured_answer => {
input => ['1 hectare'],
operation => 'convert',
operation => 'Convert',
result => '10,000 square meters'
}
),
@ -652,7 +652,7 @@ ddg_goodie_test(
'1 acre = 0.004 square kilometers',
structured_answer => {
input => ['1 acre'],
operation => 'convert',
operation => 'Convert',
result => '0.004 square kilometers'
}
),
@ -660,7 +660,7 @@ ddg_goodie_test(
'1 acre = 4,046.873 square meters',
structured_answer => {
input => ['1 acre'],
operation => 'convert',
operation => 'Convert',
result => '4,046.873 square meters'
}
),
@ -669,7 +669,7 @@ ddg_goodie_test(
'1 inch = 2.540 centimeters',
structured_answer => {
input => ['1 inch'],
operation => 'convert',
operation => 'Convert',
result => '2.540 centimeters'
}
),
@ -677,7 +677,7 @@ ddg_goodie_test(
'10 yards = 9.144 meters',
structured_answer => {
input => ['10 yards'],
operation => 'convert',
operation => 'Convert',
result => '9.144 meters'
}
),
@ -685,7 +685,7 @@ ddg_goodie_test(
'42 days = 60,480 minutes',
structured_answer => {
input => ['42 days'],
operation => 'convert',
operation => 'Convert',
result => '60,480 minutes'
}
),
@ -693,7 +693,7 @@ ddg_goodie_test(
'40 kelvin = -233.150 degrees celsius',
structured_answer => {
input => ['40 kelvin'],
operation => 'convert',
operation => 'Convert',
result => '-233.150 degrees celsius'
}
),
@ -701,7 +701,7 @@ ddg_goodie_test(
'40 kelvin = -233.150 degrees celsius',
structured_answer => {
input => ['40 kelvin'],
operation => 'convert',
operation => 'Convert',
result => '-233.150 degrees celsius'
}
),
@ -709,7 +709,7 @@ ddg_goodie_test(
'10 yards = 9.144 meters',
structured_answer => {
input => ['10 yards'],
operation => 'convert',
operation => 'Convert',
result => '9.144 meters'
}
),
@ -717,7 +717,7 @@ ddg_goodie_test(
'10 yards = 9.144 meters',
structured_answer => {
input => ['10 yards'],
operation => 'convert',
operation => 'Convert',
result => '9.144 meters'
}
),
@ -725,7 +725,7 @@ ddg_goodie_test(
'1 kilogram = 2.205 pounds',
structured_answer => {
input => ['1 kilogram'],
operation => 'convert',
operation => 'Convert',
result => '2.205 pounds'
}
),
@ -733,7 +733,7 @@ ddg_goodie_test(
'1 kilogram = 2.205 pounds',
structured_answer => {
input => ['1 kilogram'],
operation => 'convert',
operation => 'Convert',
result => '2.205 pounds'
}
),
@ -741,7 +741,7 @@ ddg_goodie_test(
'1 pound = 0.454 kilograms',
structured_answer => {
input => ['1 pound'],
operation => 'convert',
operation => 'Convert',
result => '0.454 kilograms'
}
),
@ -749,7 +749,7 @@ ddg_goodie_test(
'1 meter = 100 centimeters',
structured_answer => {
input => ['1 meter'],
operation => 'convert',
operation => 'Convert',
result => '100 centimeters'
}
),
@ -757,7 +757,7 @@ ddg_goodie_test(
'1 centimeter = 0.010 meters',
structured_answer => {
input => ['1 centimeter'],
operation => 'convert',
operation => 'Convert',
result => '0.010 meters'
}
),
@ -765,7 +765,7 @@ ddg_goodie_test(
'1 inch = 2.540 centimeters',
structured_answer => {
input => ['1 inch'],
operation => 'convert',
operation => 'Convert',
result => '2.540 centimeters'
}
),
@ -773,7 +773,7 @@ ddg_goodie_test(
'1 litre = 0.264 us gallons',
structured_answer => {
input => ['1 litre'],
operation => 'convert',
operation => 'Convert',
result => '0.264 us gallons'
}
),
@ -781,7 +781,7 @@ ddg_goodie_test(
'1 us gallon = 3.785 litres',
structured_answer => {
input => ['1 us gallon'],
operation => 'convert',
operation => 'Convert',
result => '3.785 litres'
}
),
@ -789,7 +789,7 @@ ddg_goodie_test(
'1 litre = 0.264 us gallons',
structured_answer => {
input => ['1 litre'],
operation => 'convert',
operation => 'Convert',
result => '0.264 us gallons'
}
),
@ -797,7 +797,7 @@ ddg_goodie_test(
'100 meters = 10,000 centimeters',
structured_answer => {
input => ['100 meters'],
operation => 'convert',
operation => 'Convert',
result => '10,000 centimeters'
}
),

View File

@ -12,7 +12,7 @@ my @overjan = (
'01 Jan 2012 + 32 days is 02 Feb 2012',
structured_answer => {
input => ['01 Jan 2012 + 32 days'],
operation => 'date math',
operation => 'Date math',
result => '02 Feb 2012',
},
);
@ -21,7 +21,7 @@ my @first_sec = (
'01 Jan 2012 + 1 day is 02 Jan 2012',
structured_answer => {
input => ['01 Jan 2012 + 1 day'],
operation => 'date math',
operation => 'Date math',
result => '02 Jan 2012',
},
);
@ -38,7 +38,7 @@ ddg_goodie_test([qw(
qr/01 Jan [0-9]{4} \+ 32 days is 02 Feb [0-9]{4}/,
structured_answer => {
input => '-ANY-',
operation => 'date math',
operation => 'Date math',
result => qr/02 Feb [0-9]{4}/,
},
),
@ -47,7 +47,7 @@ ddg_goodie_test([qw(
'01 Jan 2012 + 5 weeks is 05 Feb 2012',
structured_answer => {
input => ['01 Jan 2012 + 5 weeks'],
operation => 'date math',
operation => 'Date math',
result => '05 Feb 2012',
},
),
@ -55,7 +55,7 @@ ddg_goodie_test([qw(
'01 Jan 2012 + 5 months is 01 Jun 2012',
structured_answer => {
input => ['01 Jan 2012 + 5 months'],
operation => 'date math',
operation => 'Date math',
result => '01 Jun 2012',
},
),
@ -63,7 +63,7 @@ ddg_goodie_test([qw(
'01 Jan 2012 + 5 years is 01 Jan 2017',
structured_answer => {
input => ['01 Jan 2012 + 5 years'],
operation => 'date math',
operation => 'Date math',
result => '01 Jan 2017',
},
),
@ -74,7 +74,7 @@ ddg_goodie_test([qw(
'01 Jan 2012 - 10 days is 22 Dec 2011',
structured_answer => {
input => ['01 Jan 2012 - 10 days'],
operation => 'date math',
operation => 'Date math',
result => '22 Dec 2011',
},
),
@ -82,7 +82,7 @@ ddg_goodie_test([qw(
'01 Jan 2014 + 2 weeks is 15 Jan 2014',
structured_answer => {
input => ['01 Jan 2014 + 2 weeks'],
operation => 'date math',
operation => 'Date math',
result => '15 Jan 2014',
},
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'There are 366 days between 01 Jan 2000 and 01 Jan 2001.',
structured_answer => {
input => ['01 Jan 2000', '01 Jan 2001'],
operation => 'days between',
operation => 'Days between',
result => 366
},
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'There are 5728 days between 04 Mar 2005 and 08 Nov 2020.',
structured_answer => {
input => ['04 Mar 2005', '08 Nov 2020'],
operation => 'days between',
operation => 'Days between',
result => 5728
},
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'There are 802 days between 02 Jan 2003 and 14 Mar 2005.',
structured_answer => {
input => ['02 Jan 2003', '14 Mar 2005'],
operation => 'days between',
operation => 'Days between',
result => 802
},
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'There are 366 days between 31 Jan 2000 and 31 Jan 2001.',
structured_answer => {
input => ['31 Jan 2000', '31 Jan 2001'],
operation => 'days between',
operation => 'Days between',
result => 366
},
),
@ -70,7 +70,7 @@ ddg_goodie_test(
"There are 284158 days between 01 Jan 1234 and 01 Jan 2012.",
structured_answer => {
input => ['01 Jan 1234', '01 Jan 2012'],
operation => 'days between',
operation => 'Days between',
result => 284158
},
),
@ -86,7 +86,7 @@ ddg_goodie_test(
qr/^There are 45 days between.+and 15 Feb [0-9]{4}\.$/,
structured_answer => {
input => '-ANY-',
operation => 'days between',
operation => 'Days between',
result => 45
},
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'There are 0.625 em in 10 px (assuming a 16px font size)',
structured_answer => {
input => ['10px', '16px font size'],
operation => 'convert to em',
operation => 'Convert to em',
result => '0.625em'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'There are 16 px in 1 em (assuming a 16px font size)',
structured_answer => {
input => ['1em', '16px font size'],
operation => 'convert to px',
operation => 'Convert to px',
result => '16px'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
"There is 1 em in 12.2 px (assuming a 12.2px font size)",
structured_answer => {
input => ['12.2px', '12.2px font size'],
operation => 'convert to em',
operation => 'Convert to em',
result => '1em'
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'There are 0.7625 em in 12.2 px (assuming a 16px font size)',
structured_answer => {
input => ['12.2px', '16px font size'],
operation => 'convert to em',
operation => 'Convert to em',
result => '0.7625em'
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
qr/appears to be valid/,
structured_answer => {
input => ['foo@example.com'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/appears to be valid/
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
qr/appears to be valid/,
structured_answer => {
input => ['foo+abc@example.com'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/appears to be valid/
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
qr/appears to be valid/,
structured_answer => {
input => ['foo.bar@example.com'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/appears to be valid/
}
),
@ -39,7 +39,7 @@ ddg_goodie_test(
qr/Please check the address/,
structured_answer => {
input => '-ANY-',
operation => 'email address validation',
operation => 'Email address validation',
result => qr/Please check the address/,
}
),
@ -47,7 +47,7 @@ ddg_goodie_test(
qr/appears to be valid/,
structured_answer => {
input => ['foo@example.com'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/appears to be valid/
}
),
@ -55,7 +55,7 @@ ddg_goodie_test(
qr/Please check the fully qualified domain name/,
structured_answer => {
input => ['foo@!!!.com'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/Please check the fully qualified domain name/,
}
),
@ -63,7 +63,7 @@ ddg_goodie_test(
qr/Please check the top-level domain/,
structured_answer => {
input => ['foo@example.lmnop'],
operation => 'email address validation',
operation => 'Email address validation',
result => qr/Please check the top-level domain/,
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'Factors of 30: 1, 2, 3, 5, 6, 10, 15, 30',
structured_answer => {
input => ['30'],
operation => 'factors',
operation => 'Factors',
result => '1, 2, 3, 5, 6, 10, 15, 30'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'Factors of 72: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72',
structured_answer => {
input => ['72'],
operation => 'factors',
operation => 'Factors',
result => '1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'Factors of 30: 1, 2, 3, 5, 6, 10, 15, 30',
structured_answer => {
input => ['30'],
operation => 'factors',
operation => 'Factors',
result => '1, 2, 3, 5, 6, 10, 15, 30'
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'Factors of 72: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72',
structured_answer => {
input => ['72'],
operation => 'factors',
operation => 'Factors',
result => '1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72'
}
),

View File

@ -15,7 +15,7 @@ ddg_goodie_test(
"\x{0287}\x{0073}\x{01DD}\x{0287}",
structured_answer => {
input => ['test'],
operation => 'flip text',
operation => 'Flip text',
result => '&#x287;s&#x1DD;&#x287;'
}
),
@ -23,7 +23,7 @@ ddg_goodie_test(
"\x{0287}\x{0073}\x{01DD}\x{0287}",
structured_answer => {
input => ['test'],
operation => 'flip text',
operation => 'Flip text',
result => '&#x287;s&#x1DD;&#x287;'
}
),
@ -31,7 +31,7 @@ ddg_goodie_test(
'ǝɔuǝʇuǝs ʎɯ',
structured_answer => {
input => ['my sentence'],
operation => 'flip text',
operation => 'Flip text',
result => '&#x1DD;&#x254;u&#x1DD;&#x287;u&#x1DD;s &#x28E;&#x26F;'
}
),
@ -39,7 +39,7 @@ ddg_goodie_test(
'ʇxǝʇ',
structured_answer => {
input => ['text'],
operation => 'flip text',
operation => 'Flip text',
result => '&#x287;x&#x1DD;&#x287;'
}
),

View File

@ -12,7 +12,7 @@ my @fortune = (
'-ANY-',
structured_answer => {
input => [],
operation => 'random fortune',
operation => 'Random fortune',
result => '-ANY-'
});

View File

@ -8,7 +8,7 @@ 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 = (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}$/});
ddg_goodie_test([qw( DDG::Goodie::GUID ) ],

View File

@ -15,7 +15,7 @@ my @answer = (
qr/^$text_start$mac_regxp$/,
structured_answer => {
input => [],
operation => 'random MAC address',
operation => 'Random MAC address',
result => qr/$mac_regxp/
});

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'Greatest common factor of 9 and 81 is 9.',
structured_answer => {
input => [9, 81],
operation => 'greatest common factor',
operation => 'Greatest common factor',
result => 9
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'Greatest common factor of 100 and 1000 is 100.',
structured_answer => {
input => [100, 1000],
operation => 'greatest common factor',
operation => 'Greatest common factor',
result => 100
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'Greatest common factor of 12 and 76 is 4.',
structured_answer => {
input => [12, 76],
operation => 'greatest common factor',
operation => 'Greatest common factor',
result => 4
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'Greatest common factor of 11 and 121 is 11.',
structured_answer => {
input => [11, 121],
operation => 'greatest common factor',
operation => 'Greatest common factor',
result => 11
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'Greatest common factor of 9 and 99 is 9.',
structured_answer => {
input => [9, 99],
operation => 'greatest common factor',
operation => 'Greatest common factor',
result => 9
}
),

View File

@ -15,7 +15,7 @@ ddg_goodie_test(
'test (ASCII)',
structured_answer => {
input => ['0x7465007374'],
operation => 'hex to ASCII',
operation => 'Hex to ASCII',
result => 'te<code title="null">[NUL]</code>st'
}
),
@ -23,7 +23,7 @@ ddg_goodie_test(
'test (ASCII)',
structured_answer => {
input => ['0x74657374'],
operation => 'hex to ASCII',
operation => 'Hex to ASCII',
result => 'test',
}
),
@ -31,7 +31,7 @@ ddg_goodie_test(
'This is a test (ASCII)',
structured_answer => {
input => ['0x5468697320697320612074657374'],
operation => 'hex to ASCII',
operation => 'Hex to ASCII',
result => 'This is a test',
}
),
@ -42,7 +42,7 @@ ddg_goodie_test(
input => [
'0x466f7220736f6d6520726561736f6e2c2049206465636964656420746f2061736b20612073656172636820656e67696e6520746f20636f6e766572742068657820746f2041534349492e0d0a436f6f6c2c20746869732073656172636820656e67696e6520646f65732069742c20756e74696c20492072756e206f7574206f662073706163652e'
],
operation => 'hex to ASCII',
operation => 'Hex to ASCII',
result =>
'For some reason, I decided to ask a search engine to convert hex to ASCII.<code title="carriage return">[CR]</code><code title="linefeed">[LF]</code>Cool, this search engine does it, until I run out of &hellip;',
},

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'd1038d2e07b42569 base 16 = 15061036807694329193 base 10',
structured_answer => {
input => ['0xd1038d2e07b42569'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => 15061036807694329193
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'44696f21 base 16 = 1147760417 base 10',
structured_answer => {
input => ['0x44696f21'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => 1147760417,
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'ffffffffffffffffffffff base 16 = 309485009821345068724781055 base 10',
structured_answer => {
input => ['0xffffffffffffffffffffff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "309485009821345068724781055",
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'ff base 16 = 255 base 10',
structured_answer => {
input => ['0xff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "255",
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'ff base 16 = 255 base 10',
structured_answer => {
input => ['0xff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "255",
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'ff base 16 = 255 base 10',
structured_answer => {
input => ['0xff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "255",
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
'ff base 16 = 255 base 10',
structured_answer => {
input => ['0xff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "255",
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
'ff base 16 = 255 base 10',
structured_answer => {
input => ['0xff'],
operation => 'hex to decimal',
operation => 'Hex to decimal',
result => "255",
}
),

View File

@ -17,7 +17,7 @@ ddg_goodie_test(
'Leet Speak: |-|3|_|_0 \^/0|2|_|) !',
structured_answer => {
input => ['hello world !'],
operation => 'leet speak',
operation => 'Leet speak',
result => '|-|3|_|_0 \^/0|2|_|) !'
}
),
@ -25,7 +25,7 @@ ddg_goodie_test(
'Leet Speak: |-|3|_|_0 \^/0|2|_|) !',
structured_answer => {
input => ['hElLo WORlD !'],
operation => 'leet speak',
operation => 'Leet speak',
result => '|-|3|_|_0 \^/0|2|_|) !'
}
),
@ -33,7 +33,7 @@ ddg_goodie_test(
q~Leet Speak: \^/|-|/-\'][' 15~,
structured_answer => {
input => ['what is'],
operation => 'leet speak',
operation => 'Leet speak',
result => q~\^/|-|/-\'][' 15~,
}
),
@ -41,7 +41,7 @@ ddg_goodie_test(
q~Leet Speak: |_33']['5|D3/-\|<~,
structured_answer => {
input => ['leetspeak'],
operation => 'leet speak',
operation => 'Leet speak',
result => q~|_33']['5|D3/-\|<~,
}
),
@ -49,7 +49,7 @@ ddg_goodie_test(
q~Leet Speak: /!§ ;€~,
structured_answer => {
input => ['/!§ ;€'],
operation => 'leet speak',
operation => 'Leet speak',
result => q~/!§ ;€~,
}
),

View File

@ -15,7 +15,7 @@ ddg_goodie_test(
'foo',
structured_answer => {
input => ['foo'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'foo'
},
),
@ -23,7 +23,7 @@ ddg_goodie_test(
'foo',
structured_answer => {
input => ['foO'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'foo'
},
),
@ -31,7 +31,7 @@ ddg_goodie_test(
'john doe',
structured_answer => {
input => ['john Doe'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'john doe'
},
),
@ -39,7 +39,7 @@ ddg_goodie_test(
'github',
structured_answer => {
input => ['GitHub'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'github'
},
),
@ -47,7 +47,7 @@ ddg_goodie_test(
'github',
structured_answer => {
input => ['GitHub'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'github'
},
),
@ -55,7 +55,7 @@ ddg_goodie_test(
'github',
structured_answer => {
input => ['GitHub'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'github'
},
),
@ -63,7 +63,7 @@ ddg_goodie_test(
'github',
structured_answer => {
input => ['GitHub'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'github'
},
),
@ -71,7 +71,7 @@ ddg_goodie_test(
'github',
structured_answer => {
input => ['GitHub'],
operation => 'lowercase',
operation => 'Lowercase',
result => 'github'
},
),

View File

@ -23,7 +23,7 @@ ddg_goodie_test(
$ascii_answer,
structured_answer => {
input => [],
operation => 'current lunar phase',
operation => 'Current lunar phase',
result => $phases,
}
),
@ -31,7 +31,7 @@ ddg_goodie_test(
$ascii_answer,
structured_answer => {
input => [],
operation => 'current lunar phase',
operation => 'Current lunar phase',
result => $phases,
}
),
@ -39,7 +39,7 @@ ddg_goodie_test(
$ascii_answer,
structured_answer => {
input => [],
operation => 'current lunar phase',
operation => 'Current lunar phase',
result => $phases,
}
),
@ -47,7 +47,7 @@ ddg_goodie_test(
$ascii_answer,
structured_answer => {
input => [],
operation => 'current lunar phase',
operation => 'Current lunar phase',
result => $phases,
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'841mm x 1189mm (33.11in x 46.81in)',
structured_answer => {
input => ['A0'],
operation => 'paper size',
operation => 'Paper size',
result => '841mm x 1189mm (33.11in x 46.81in)'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'28mm x 40mm (1.10in x 1.57in)',
structured_answer => {
input => ['C10'],
operation => 'paper size',
operation => 'Paper size',
result => '28mm x 40mm (1.10in x 1.57in)'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'31mm x 44mm (1.22in x 1.73in)',
structured_answer => {
input => ['B10'],
operation => 'paper size',
operation => 'Paper size',
result => '31mm x 44mm (1.22in x 1.73in)'
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'210mm x 279mm (8.27in x 11in)',
structured_answer => {
input => ['letter'],
operation => 'paper size',
operation => 'Paper size',
result => '210mm x 279mm (8.27in x 11in)'
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'216mm x 356mm (8.5in x 14in)',
structured_answer => {
input => ['legal'],
operation => 'paper size',
operation => 'Paper size',
result => '216mm x 356mm (8.5in x 14in)'
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'203mm x 127mm (8in x 5in)',
structured_answer => {
input => ['junior legal'],
operation => 'paper size',
operation => 'Paper size',
result => '203mm x 127mm (8in x 5in)'
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
'432mm x 279mm (17in x 11in)',
structured_answer => {
input => ['ledger'],
operation => 'paper size',
operation => 'Paper size',
result => '432mm x 279mm (17in x 11in)'
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
'279mm x 432mm (11in x 17in)',
structured_answer => {
input => ['tabloid'],
operation => 'paper size',
operation => 'Paper size',
result => '279mm x 432mm (11in x 17in)'
}
),

View File

@ -44,7 +44,7 @@ sub count_words {
qr/^random passphrase: $words_re$/,
structured_answer => {
input => [($count > 1) ? $count . ' words' : '1 word'],
operation => 'random passphrase',
operation => 'Random passphrase',
result => qr/^$words_re$/,
});
}

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
qr/.{5} \(random password\)/,
structured_answer => {
input => ['5 characters', 'low strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{5}$/
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
qr/.{5} \(random password\)/,
structured_answer => {
input => ['5 characters', 'low strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{5}$/
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
qr/.{5} \(random password\)/,
structured_answer => {
input => ['5 characters', 'low strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{5}$/
}
),
@ -38,7 +38,7 @@ ddg_goodie_test(
qr/.{15} \(random password\)/,
structured_answer => {
input => ['15 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{15}$/
}
),
@ -46,7 +46,7 @@ ddg_goodie_test(
qr/.{15} \(random password\)/,
structured_answer => {
input => ['15 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{15}$/
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
qr/.{15} \(random password\)/,
structured_answer => {
input => ['15 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{15}$/
}
),
@ -62,7 +62,7 @@ ddg_goodie_test(
qr/.{25} \(random password\)/,
structured_answer => {
input => ['25 characters', 'high strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{25}$/
}
),
@ -70,7 +70,7 @@ ddg_goodie_test(
qr/.{25} \(random password\)/,
structured_answer => {
input => ['25 characters', 'high strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{25}$/
}
),
@ -78,7 +78,7 @@ ddg_goodie_test(
qr/.{25} \(random password\)/,
structured_answer => {
input => ['25 characters', 'high strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{25}$/
}
),
@ -87,7 +87,7 @@ ddg_goodie_test(
qr/.{8} \(random password\)/,
structured_answer => {
input => ['8 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{8}$/
}
),
@ -95,7 +95,7 @@ ddg_goodie_test(
qr/.{15} \(random password\)/,
structured_answer => {
input => ['15 characters', 'high strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{15}$/
}
),
@ -103,7 +103,7 @@ ddg_goodie_test(
qr/.{15} \(random password\)/,
structured_answer => {
input => ['15 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{15}$/
}
),
@ -111,7 +111,7 @@ ddg_goodie_test(
qr/.{33} \(random password\)/,
structured_answer => {
input => ['33 characters', 'average strength'],
operation => 'random password',
operation => 'Random password',
result => qr/^.{33}$/
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'Pig Latin: illway isthay orkway?',
structured_answer => {
input => ['will this work?'],
operation => 'translate to Pig Latin',
operation => 'Translate to Pig Latin',
result => 'illway isthay orkway?'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'Pig Latin: iway ovelay uckduckgoday',
structured_answer => {
input => ['i love duckduckgo'],
operation => 'translate to Pig Latin',
operation => 'Translate to Pig Latin',
result => 'iway ovelay uckduckgoday'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'Pig Latin: iway ovelay uckduckgoday',
structured_answer => {
input => ['i love duckduckgo'],
operation => 'translate to Pig Latin',
operation => 'Translate to Pig Latin',
result => 'iway ovelay uckduckgoday'
}
),

View File

@ -14,14 +14,14 @@ ddg_goodie_test(
qr/\d{2} \(random number\)/,
structured_answer => {
input => [12, 45],
operation => 'random number between',
operation => 'Random number between',
result => qr/^\d{2}$/
}
),
'random number' => test_zci(qr/\d{1}\.\d+ \(random number\)/,
structured_answer => {
input => [0, 1],
operation => 'random number between',
operation => 'Random number between',
result => qr/\d{1}\.\d+/,
}
),

View File

@ -15,7 +15,7 @@ ddg_goodie_test(
'Reversed "esrever": reverse',
structured_answer => {
input => ['esrever'],
operation => 'reverse string',
operation => 'Reverse string',
result => 'reverse'
}
),
@ -24,7 +24,7 @@ ddg_goodie_test(
'Reversed "bla": alb',
structured_answer => {
input => ['bla'],
operation => 'reverse string',
operation => 'Reverse string',
result => 'alb'
}
),
@ -32,7 +32,7 @@ ddg_goodie_test(
'Reversed "blabla": albalb',
structured_answer => {
input => ['blabla'],
operation => 'reverse string',
operation => 'Reverse string',
result => 'albalb'
}
),

View File

@ -12,7 +12,7 @@ my @aaaacccggt = (
"ACCGGGTTTT",
structured_answer => {
input => ['AAAACCCGGT'],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result => 'ACCGGGTTTT'
});
@ -25,7 +25,7 @@ ddg_goodie_test(
"ACGCCGCCAGCGTTCGTCCTGAGCCATGATCAAA",
structured_answer => {
input => ['TTTGATCATGGCTCAGGACGAACGCTGGCGGCGT'],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result => 'ACGCCGCCAGCGTTCGTCCTGAGCCATGATCAAA'
}
),
@ -37,7 +37,7 @@ ddg_goodie_test(
"ACCGGGTTTT",
structured_answer => {
input => ['AAAACCCGGU'],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result => 'ACCGGGTTTT'
}
),
@ -47,7 +47,7 @@ ddg_goodie_test(
"TCCGTCTGA",
structured_answer => {
input => ['UCAGACGGA'],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result => 'TCCGTCTGA',
}
),
@ -55,7 +55,7 @@ ddg_goodie_test(
"TCCGTCTGA",
structured_answer => {
input => ['UCAGACGGA'],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result => 'TCCGTCTGA',
}
),
@ -68,7 +68,7 @@ ddg_goodie_test(
input => [
'TCAAAWWDGGATTAMATACCCTGGTAGTCCACRCCATAAACGATGTATGCTTGGTGRGVGTGAGTAATCACTCAGTMCGAAGGCAACCTGATAAGCATACCKCCTVGAGTACGATCSCAAGGTTGAAACTCA'
],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result =>
'TGAGTTTCAACCTTGSGATCGTACTCBAGGMGGTATGCTTATCAGGTTGCCTTCGKACTGAGTGATTACTCACBCYCACCAAGCATACATCGTTTATGGYGTGGACTACCAGGGTATKTAATCCHWWTTTGA'
},
@ -80,7 +80,7 @@ ddg_goodie_test(
input => [
'CUAKCCAAGCCGACGASUCGGUAGCUGGUCUGAGAGKGACGAACAGCCACACUGGAACUGAGACAYCGGUCCAGACUCCUACGGGAGGCAGCAGUGAGGAAUAUUGGUCAAKUGGACRGCAAGUCUGAACCAYGCGACGRCGCGUGCGGGAUGAAGGGGCUUAGCCUCGUAAACDCGCURGUCAAGAGGGACGAGAGGHGCGAUUUUGUMCGUCCGGGWWACGV'
],
operation => 'nucleotide reverse complement',
operation => 'Nucleotide reverse complement',
result =>
'BCGTWWCCCGGACGKACAAAATCGCDCCTCTCGTCCCTCTTGACYAGCGHGTTTACGAGGCTAAGCCCCTTCATCCCGCACGCGYCGTCGCRTGGTTCAGACTTGCYGTCCAMTTGACCAATATTCCTCACTGCTGCCTCCCGTAGGAGTCTGGACCGRTGTCTCAGTTCCAGTGTGGCTGTTCGTCMCTCTCAGACCAGCTACCGASTCGTCGGCTTGGMTAG'
},

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'-3, -1, 4, 5.7 (Sorted ascendingly)',
structured_answer => {
input => ['-1, 4, -3, 5.7'],
operation => 'sort ascendingly',
operation => 'Sort ascendingly',
result => '-3, -1, 4, 5.7'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'-3, -1, 4, 5.7 (Sorted ascendingly)',
structured_answer => {
input => ['-1, 4, -3, 5.7'],
operation => 'sort ascendingly',
operation => 'Sort ascendingly',
result => '-3, -1, 4, 5.7'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'-3, -1, 4, 5.7 (Sorted ascendingly)',
structured_answer => {
input => ['-1, 4, -3, 5.7'],
operation => 'sort ascendingly',
operation => 'Sort ascendingly',
result => '-3, -1, 4, 5.7'
}
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'-10, -3, 10, 56 (Sorted ascendingly)',
structured_answer => {
input => ['-3, -10, 56, 10'],
operation => 'sort ascendingly',
operation => 'Sort ascendingly',
result => '-10, -3, 10, 56'
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'Test This Out',
structured_answer => {
input => ['test this out'],
operation => 'title case',
operation => 'Title case',
result => 'Test This Out'
},
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'This Is a Walk in the Park',
structured_answer => {
input => ['this is a walk in the park'],
operation => 'title case',
operation => 'Title case',
result => 'This Is a Walk in the Park'
},
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'A Good Day to Die Hard',
structured_answer => {
input => ['a good day to die hard'],
operation => 'title case',
operation => 'Title case',
result => 'A Good Day to Die Hard'
},
),
@ -38,7 +38,7 @@ ddg_goodie_test(
'A Good Day to Die Hard',
structured_answer => {
input => ['A GOOD DAY TO DIE HARD'],
operation => 'title case',
operation => 'Title case',
result => 'A Good Day to Die Hard'
},
),
@ -46,7 +46,7 @@ ddg_goodie_test(
'Here I Am Testing-Hyphenated-Words',
structured_answer => {
input => ['here i am testing-hyphenated-words'],
operation => 'title case',
operation => 'Title case',
result => 'Here I Am Testing-Hyphenated-Words'
},
),
@ -54,7 +54,7 @@ ddg_goodie_test(
'Test',
structured_answer => {
input => ['test'],
operation => 'title case',
operation => 'Title case',
result => 'Test'
},
),

View File

@ -12,42 +12,42 @@ my @noon = (
'12:00pm is noon.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => '12:00pm is noon.'
});
my @correct_noon = (
'Yes, 12:00pm is noon.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => 'Yes, 12:00pm is noon.'
});
my @wrong_noon = (
'No, 12:00pm is noon.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => 'No, 12:00pm is noon.'
});
my @midnight = (
'12:00am is midnight.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => '12:00am is midnight.'
});
my @correct_midnight = (
'Yes, 12:00am is midnight.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => 'Yes, 12:00am is midnight.'
});
my @wrong_midnight = (
'No, 12:00am is midnight.',
structured_answer => {
input => [],
operation => 'midnight or noon',
operation => 'Midnight or noon',
result => 'No, 12:00am is midnight.'
});

View File

@ -16,7 +16,7 @@ ddg_goodie_test(
'Forty-two',
structured_answer => {
input => [],
operation => 'the answer to the ultimate question of life, the universe and everything',
operation => 'The answer to the ultimate question of life, the universe and everything',
result => 'Forty-two',
}
),

View File

@ -14,7 +14,7 @@ ddg_goodie_test(
'THIS',
structured_answer => {
input => ['this'],
operation => 'uppercase',
operation => 'Uppercase',
result => 'THIS'
}
),
@ -22,7 +22,7 @@ ddg_goodie_test(
'THAT',
structured_answer => {
input => ['that'],
operation => 'uppercase',
operation => 'Uppercase',
result => 'THAT'
}
),
@ -30,7 +30,7 @@ ddg_goodie_test(
'THIS STRING',
structured_answer => {
input => ['this string'],
operation => 'uppercase',
operation => 'Uppercase',
result => 'THIS STRING'
}
),

View File

@ -15,7 +15,7 @@ ddg_goodie_test(
'Valar dohaeris',
structured_answer => {
input => ['Valar morghulis'],
operation => 'code phrase',
operation => 'Code phrase',
result => 'Valar dohaeris'
}
),

View File

@ -12,7 +12,7 @@ my @six_to_ten = (
"There are 5 weekdays between 06 Jan 2014 and 10 Jan 2014.",
structured_answer => {
input => ['06 Jan 2014', '10 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 5,
});
@ -24,7 +24,7 @@ ddg_goodie_test(
"There are 263 weekdays between 31 Jan 2000 and 31 Jan 2001.",
structured_answer => {
input => ['31 Jan 2000', '31 Jan 2001'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 263,
}
),
@ -45,7 +45,7 @@ ddg_goodie_test(
"There are 6 weekdays between 06 Jan 2014 and 13 Jan 2014.",
structured_answer => {
input => ['06 Jan 2014', '13 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 6,
}
),
@ -55,7 +55,7 @@ ddg_goodie_test(
"There are 262 weekdays between 01 Jan 2014 and 01 Jan 2015.",
structured_answer => {
input => ['01 Jan 2014', '01 Jan 2015'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 262,
}
),
@ -74,7 +74,7 @@ ddg_goodie_test(
"There are 2 weekdays between 03 Jan 2014 and 06 Jan 2014.",
structured_answer => {
input => ['03 Jan 2014', '06 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 2,
}
),
@ -84,7 +84,7 @@ ddg_goodie_test(
"There is 1 weekday between 03 Jan 2014 and 03 Jan 2014.",
structured_answer => {
input => ['03 Jan 2014', '03 Jan 2014'],
operation => 'weekday between',
operation => 'Weekday between',
result => 1,
}
),
@ -94,7 +94,7 @@ ddg_goodie_test(
"There are 0 weekdays between 04 Jan 2014 and 04 Jan 2014.",
structured_answer => {
input => ['04 Jan 2014', '04 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 0,
}
),
@ -104,7 +104,7 @@ ddg_goodie_test(
"There are 2 weekdays between 11 Jan 2014 and 14 Jan 2014.",
structured_answer => {
input => ['11 Jan 2014', '14 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 2,
}
),
@ -114,7 +114,7 @@ ddg_goodie_test(
"There are 5 weekdays between 12 Jan 2014 and 17 Jan 2014.",
structured_answer => {
input => ['12 Jan 2014', '17 Jan 2014'],
operation => 'weekdays between',
operation => 'Weekdays between',
result => 5,
}
),

View File

@ -12,7 +12,7 @@ my @test_loc = (
'Lat: 40.1246, Lon: -75.5385 (near Phoenixville, PA)',
structured_answer => {
input => [],
operation => 'apparent current location',
operation => 'Apparent current location',
result => 'Lat: 40.1246, Lon: -75.5385 (near Phoenixville, PA)'
});

View File

@ -12,84 +12,84 @@ my @six_to_ten = (
'There are 5 workdays between 06 Jan 2014 and 10 Jan 2014.',
structured_answer => {
input => ['06 Jan 2014', '10 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 5,
});
my @twentyfourteen = (
'There are 251 workdays between 01 Jan 2014 and 01 Jan 2015.',
structured_answer => {
input => ['01 Jan 2014', '01 Jan 2015'],
operation => 'workdays between',
operation => 'Workdays between',
result => 251,
});
my @twoohoh = (
'There are 253 workdays between 31 Jan 2000 and 31 Jan 2001.',
structured_answer => {
input => ['31 Jan 2000', '31 Jan 2001'],
operation => 'workdays between',
operation => 'Workdays between',
result => 253,
});
my @midjune = (
'There are 12 workdays between 05 Jun 2014 and 20 Jun 2014.',
structured_answer => {
input => ['05 Jun 2014', '20 Jun 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 12,
});
my @midjan = (
'There are 6 workdays between 06 Jan 2014 and 13 Jan 2014.',
structured_answer => {
input => ['06 Jan 2014', '13 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 6,
});
my @somejan = (
'There are 5 workdays between 06 Jan 2014 and 12 Jan 2014.',
structured_answer => {
input => ['06 Jan 2014', '12 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 5,
});
my @somesat = (
'There are 2 workdays between 11 Jan 2014 and 14 Jan 2014.',
structured_answer => {
input => ['11 Jan 2014', '14 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 2,
});
my @somesun = (
'There are 2 workdays between 12 Jan 2014 and 14 Jan 2014.',
structured_answer => {
input => ['12 Jan 2014', '14 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 2,
});
my @latejun = (
'There are 5 workdays between 16 Jun 2014 and 20 Jun 2014.',
structured_answer => {
input => ['16 Jun 2014', '20 Jun 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 5,
});
my @sameday = (
'There is 1 workday between 03 Jan 2014 and 03 Jan 2014.',
structured_answer => {
input => ['03 Jan 2014', '03 Jan 2014'],
operation => 'workday between',
operation => 'Workday between',
result => 1,
});
my @samedaywknd = (
'There are 0 workdays between 04 Jan 2014 and 04 Jan 2014.',
structured_answer => {
input => ['04 Jan 2014', '04 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 0,
});
my @weekend_middle = (
'There are 2 workdays between 03 Jan 2014 and 06 Jan 2014.',
structured_answer => {
input => ['03 Jan 2014', '06 Jan 2014'],
operation => 'workdays between',
operation => 'Workdays between',
result => 2,
});
@ -186,7 +186,7 @@ ddg_goodie_test(
qr"There are [1-9] workdays between 10 Jan [0-9]{4} and 20 Jan [0-9]{4}\.",
structured_answer => {
input => '-ANY-',
operation => 'workdays between',
operation => 'Workdays between',
result => qr/[1-9]/,
}
),
@ -195,7 +195,7 @@ ddg_goodie_test(
qr"There are [1-9][0-9] workdays between 01 Jan [0-9]{4} and 01 Feb [0-9]{4}\.",
structured_answer => {
input => '-ANY-',
operation => 'workdays between',
operation => 'Workdays between',
result => qr/[1-9][0-9]/,
}
),
@ -207,7 +207,7 @@ ddg_goodie_test(
"There are 2 workdays between 03 Jan 2013 and 04 Jan 2013.",
structured_answer => {
input => ['03 Jan 2013', '04 Jan 2013'],
operation => 'workdays between',
operation => 'Workdays between',
result => 2,
}
),