File: next_goto_utf8.t

package info (click to toggle)
perl 5.42.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 128,392 kB
  • sloc: perl: 534,963; ansic: 240,563; sh: 72,042; pascal: 6,934; xml: 2,428; yacc: 1,360; makefile: 1,197; cpp: 208; lisp: 1
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');