Acme-SuddenlyDeath

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

# =========================================================================
# THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA.
# DO NOT EDIT DIRECTLY.
# =========================================================================

use 5.008_001;

use strict;
use warnings;
use utf8;

use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;
use CPAN::Meta::Prereqs;

my %args = (
    license              => 'perl',
    dynamic_config       => 0,

bin/sudden-death  view on Meta::CPAN

#!perl
use strict;
use warnings;
use utf8;

use Acme::SuddenlyDeath;
use Encode;

my $str = Encode::decode_utf8($ARGV[0] || '突然の死');

print Encode::encode_utf8(sudden_death($str));
print "\n";

exit(0);

__END__

=encoding utf8

=head1 NAME

sudden-death - CLI interface of Acme::SuddenlyDeath

=head1 SYNOPSIS

    $ sudden-death [string]

    # e.g.

lib/Acme/SuddenlyDeath.pm  view on Meta::CPAN

package Acme::SuddenlyDeath;
use strict;
use warnings;
use utf8;

use parent 'Exporter';
use Text::VisualWidth::UTF8;

our @EXPORT = qw/ sudden_death sudden_death_single /;

use version; our $VERSION = '0.09';

sub _generator {
    my $decoded_str = shift;

lib/Acme/SuddenlyDeath.pm  view on Meta::CPAN

sub sudden_death_single {
    my $string = shift;

    my $ascii = _generator($string);
    return join '', @{$ascii};
}

1;
__END__

=encoding utf8

=head1 NAME

Acme::SuddenlyDeath - ASCII Art of sudden death (突然の死) generator

=head1 SYNOPSIS

  use Acme::SuddenlyDeath;

  print sudden_death('突然の死')."\n"

t/01_translate.t  view on Meta::CPAN

use strict;
use utf8;
use Acme::SuddenlyDeath;
use Test::More;

my $got;
my $expect;

subtest 'sudden_death' => sub {
    $got = sudden_death("突然の死");
    $expect = "_人人人人人_\n> 突然の死 <\n ̄^Y^Y^Y^Y^ ̄";
    is($got, $expect, 'JP');

t/02_translate_single.t  view on Meta::CPAN

use strict;
use utf8;
use Acme::SuddenlyDeath;
use Test::More;

my $got;
my $expect;

subtest "sudden_death_single" => sub {
    $got = sudden_death_single("突然の死");
    $expect = '_人人人人人_> 突然の死 < ̄^Y^Y^Y^Y^ ̄';
    is($got, $expect, 'JP');



( run in 0.817 second using v1.01-cache-2.11-cpan-49f99fa48dc )