This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: savepv() of getenv()
[perl5.git] / cpan / Socket / t / ipv6_mreq.t
CommitLineData
e27aa02b
PE
1use strict;
2use warnings;
3use Test::More;
4
5use Socket qw(
c2654555 6 pack_ipv6_mreq unpack_ipv6_mreq
e27aa02b
PE
7);
8
9# Check that pack/unpack_ipv6_mreq either croak with "Not implemented", or
10# roundtrip as identity
11
12my $packed;
13eval {
c2654555 14 $packed = pack_ipv6_mreq "ANADDRESSIN16CHR", 123;
e27aa02b
PE
15};
16if( !defined $packed ) {
c2654555
CBW
17 plan skip_all => "No pack_ipv6_mreq" if $@ =~ m/ not implemented /;
18 die $@;
e27aa02b
PE
19}
20
21plan tests => 2;
22
23my @unpacked = unpack_ipv6_mreq $packed;
24
25is( $unpacked[0], "ANADDRESSIN16CHR", 'unpack_ipv6_mreq multiaddr' );
26is( $unpacked[1], 123, 'unpack_ipv6_mreq ifindex' );