Flip and mirror both mirror now

There aren't hex codes for characters that aren't mirrored, i.e. just
flipped upside-down, so the "flip" trigger wasn't really working.
master
Robert Picard 2012-05-14 20:52:54 -04:00
parent 70b4c69cd3
commit 0722a20ccc
2 changed files with 3 additions and 13 deletions

View File

@ -87,19 +87,9 @@ my %charMap = (
"<" => ">",
"_" => "\x{203E}");
handle sub {
handle remainder => sub {
$_ =~ s/^(\s*flip\s*)//;
$_ =~ s/(\s*flip\s*)$//;
if ($_ =~ /^(\s*mirror\s*)/ || $_ =~ /(\s*mirror\s*)/) {
$_ =~ s/^(\s*mirror\s*)//;
$_ =~ s/(\s*mirror\s*)$//;
$_ = reverse $_;
}
my @string = split(//, $_);
my @string = split(//, reverse $_);
my $flippedString;
for (@string) {

View File

@ -13,7 +13,7 @@ ddg_goodie_test(
DDG::Goodie::FlipText
)],
'flip test' => test_zci("\x{0287}\x{01DD}\x{0073}\x{0287}"),
'mirror test' => test_zci("\x{0287}\x{0073}\x{01DD}\x{0287}"),
'mirror test' => test_zci("\x{0287}\x{01DD}\x{0073}\x{0287}"),
);
done_testing;