Shruggie ready for initial Push

master
epik 2015-09-04 01:21:53 +00:00
parent fe0ac8b091
commit aa3c9e9709
2 changed files with 34 additions and 10 deletions

View File

@ -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 => {

View File

@ -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.