summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/ext/XS-APItest/t/temp_lv_sub.t
blob: 938a5c2cd0e9d035def9e7ddba6eae2160a6826c (plain) (blame)
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
#!perl -w

use strict;
use utf8;
use Test::More tests => 5;

require_ok('XS::APItest');

sub make_temp_mg_lv :lvalue {  XS::APItest::TempLv::make_temp_mg_lv($_[0]); }

{
    my $x = "[]";
    eval { XS::APItest::TempLv::make_temp_mg_lv($x) = "a"; };
    is($@, '',    'temp mg lv from xs exception check');
    is($x, '[a]', 'temp mg lv from xs success');
}

{
    my $x = "{}";
    eval { make_temp_mg_lv($x) = "b"; };
    is($@, '',    'temp mg lv from pp exception check');
    is($x, '{b}', 'temp mg lv from pp success');
}

1;