This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest: Add comprehensive UTF-8 validity tests
[perl5.git] / ext / XS-APItest / t / svcatpvf.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 4;
5
6 use XS::APItest;
7
8 my @cases = (
9     [field     => '%2$d'],
10     [precision => '%.*2$d'],
11     [vector    => '%2$vd'],
12     [width     => '%*2$d'],
13 );
14
15 for my $case (@cases) {
16     my ($what, $format) = @$case;
17     my $got = eval { test_sv_catpvf($format); 1 };
18     my $exn = $got ? undef : $@;
19     like($exn, qr/\b\QCannot yet reorder sv_catpvfn() arguments from va_list\E\b/,
20          "explicit $what index forbidden in va_list arguments");
21 }