xref: /openbsd-src/gnu/usr.bin/perl/ext/XS-APItest/t/temp_lv_sub.t (revision 898184e3e61f9129feb5978fad5a8c6865f00b92)
1#!perl -w
2
3use strict;
4use utf8;
5use Test::More tests => 5;
6
7require_ok('XS::APItest');
8
9sub make_temp_mg_lv :lvalue {  XS::APItest::TempLv::make_temp_mg_lv($_[0]); }
10
11{
12    my $x = "[]";
13    eval { XS::APItest::TempLv::make_temp_mg_lv($x) = "a"; };
14    is($@, '',    'temp mg lv from xs exception check');
15    is($x, '[a]', 'temp mg lv from xs success');
16}
17
18{
19    my $x = "{}";
20    eval { make_temp_mg_lv($x) = "b"; };
21    is($@, '',    'temp mg lv from pp exception check');
22    is($x, '{b}', 'temp mg lv from pp success');
23}
24
251;
26