File: next_goto_utf8.t

package info (click to toggle)
perl 5.20.2-3%2Bdeb8u11
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 102,964 kB
  • sloc: perl: 555,553; ansic: 214,041; sh: 38,121; pascal: 8,783; cpp: 3,895; makefile: 2,393; xml: 2,325; yacc: 1,741
file content (36 lines) | stat: -rw-r--r-- 953 bytes parent folder | download | duplicates (8)
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
35
36
#!/usr/bin/perl

use strict;
use warnings;
use utf8;
use open qw( :utf8 :std );
require q(./test.pl); plan(tests => 4);

use mro;

{
    package PṞoxᚤ;
    our @ISA = qw//;
    sub next_prxᔬ { goto &next::method }
    sub maybe_prxᔬ { goto &maybe::next::method }
    sub can_prxᔬ { goto &next::can }

    package Ⱦ밧ᶟ;
    our @ISA = qw//;
    sub ᕗ { 42 }
    sub Ƚ { 24 }
    # বẔ doesn't exist intentionally
    sub ʠঊₓ { 242 }

    package ᵗ톺;
    our @ISA = qw/Ⱦ밧ᶟ/;
    sub ᕗ { shift->PṞoxᚤ::next_prxᔬ() }
    sub Ƚ { shift->PṞoxᚤ::maybe_prxᔬ() }
    sub বẔ { shift->PṞoxᚤ::maybe_prxᔬ() }
    sub ʠঊₓ { shift->PṞoxᚤ::can_prxᔬ()->() }
}

is(ᵗ톺->ᕗ, 42, 'proxy next::method via goto');
is(ᵗ톺->Ƚ, 24, 'proxy maybe::next::method via goto');
ok(!ᵗ톺->বẔ, 'proxy maybe::next::method via goto with no method');
is(ᵗ톺->ʠঊₓ, 242, 'proxy next::can via goto');