This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gv.c: Added gv_autoload4_(sv|pv|pvn)
[perl5.git] / ext / XS-APItest / t / temp_lv_sub.t
CommitLineData
e2fe06dd
EB
1#!perl -w
2
e2fe06dd
EB
3use strict;
4use utf8;
5use Test::More tests => 5;
6
e2f1cb34 7require_ok('XS::APItest');
e2fe06dd
EB
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{
e2fe06dd
EB
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;