Shruggie ready for initial Push
parent
fe0ac8b091
commit
aa3c9e9709
|
@ -45,7 +45,7 @@ handle remainder => sub {
|
|||
return $returnString,
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => [$returnString]
|
||||
result => $returnString
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -71,10 +71,9 @@ handle remainder => sub {
|
|||
};
|
||||
|
||||
} elsif ($stringAfterAnd eq "friends") {
|
||||
my @returnArray = ($returnString);
|
||||
|
||||
|
||||
foreach my $iterateThroughFriends (@arrayOfFriendFacesWithNames) {
|
||||
$returnString .= " _____ " . $iterateThroughFriends->{'image'};
|
||||
$returnString .= " ____ " . $iterateThroughFriends->{'image'};
|
||||
}
|
||||
|
||||
return $returnString,
|
||||
|
@ -88,7 +87,7 @@ handle remainder => sub {
|
|||
foreach my $nameEmojiiPair (@arrayOfFriendFacesWithNames) {
|
||||
|
||||
if (lc($nameEmojiiPair->{'name'}) eq $stringAfterAnd) {
|
||||
$returnString .= " ______ " . $nameEmojiiPair->{'image'};
|
||||
$returnString .= " ____ " . $nameEmojiiPair->{'image'};
|
||||
|
||||
return $returnString,
|
||||
structured_answer => {
|
||||
|
|
35
t/Shruggie.t
35
t/Shruggie.t
|
@ -14,18 +14,43 @@ ddg_goodie_test(
|
|||
# At a minimum, be sure to include tests for all:
|
||||
|
||||
# - primary_example_queries
|
||||
'shruggie' => test_zci('¯\_(ツ)_/¯'),
|
||||
'shruggie' => test_zci('¯\_(ツ)_/¯',
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => '¯\_(ツ)_/¯',
|
||||
}
|
||||
),
|
||||
# The next test stresses the JSON file
|
||||
# I am sure there is a better way to do this, but I can't figure out the
|
||||
# required regex
|
||||
'shruggie and friends' => test_zci(qr/.*/),
|
||||
'shruggie and friends' => test_zci(qr/.*/,
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => qr/.*/,
|
||||
}
|
||||
),
|
||||
|
||||
# - secondary_example_queries
|
||||
# Test three random emojiis. Because the config file for the emojiis is
|
||||
# desgined to be easily modified to, a full test is not a great idea
|
||||
'shruggie and Table Flip' => test_zci('¯\_(ツ)_/¯ | (╯°□°)╯︵ ┻━┻'),
|
||||
'shruggie and Anon' => test_zci('¯\_(ツ)_/¯ | ლ(ಠ益ಠლ)'),
|
||||
'shruggie AND hug me' => test_zci('¯\_(ツ)_/¯ | (っ◕‿◕)っ'),
|
||||
'shruggie and Table Flip' => test_zci('¯\_(ツ)_/¯ ____ (╯°□°)╯︵ ┻━┻',
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => '¯\_(ツ)_/¯ ____ (╯°□°)╯︵ ┻━┻',
|
||||
}
|
||||
),
|
||||
'shruggie and Anon' => test_zci('¯\_(ツ)_/¯ ____ ლ(ಠ益ಠლ)',
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => '¯\_(ツ)_/¯ ____ ლ(ಠ益ಠლ)',
|
||||
}
|
||||
),
|
||||
'shruggie AND hug me' => test_zci('¯\_(ツ)_/¯ ____ (っ◕‿◕)っ',
|
||||
structured_answer => {
|
||||
input => [],
|
||||
result => '¯\_(ツ)_/¯ ____ (っ◕‿◕)っ',
|
||||
}
|
||||
),
|
||||
|
||||
# Try to include some examples of queries on which it might
|
||||
# appear that your answer will trigger, but does not.
|
||||
|
|
Loading…
Reference in New Issue