File: 01-rough.t

package info (click to toggle)
libmoox-locale-passthrough-perl 0.001-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 88 kB
  • sloc: perl: 52; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!perl

use 5.008001;

use strict;
use warnings FATAL => 'all';

use Test::More;

{
    package    #
      TestMXLP;

    use Moo;
    with "MooX::Locale::Passthrough";

    sub pure { shift->__("Hello world") }

    sub mayby_plural
    {
        my $self = shift;
        [$self->__n("Hello world", "Hello universe", 1), $self->__n("Hello world", "Hello universe", 2),];
    }

    sub ctx { shift->__p("Alabama", "Sweet home") }
}

my $tmxlp = TestMXLP->new();

is $tmxlp->pure, "Hello world", "Pure passed through";
is_deeply $tmxlp->mayby_plural, ["Hello world", "Hello universe"], "Singular and Plural passed through";
is $tmxlp->ctx, "Sweet home", "Ctx msg passed through";

done_testing();