File: 04_swap.t

package info (click to toggle)
libdata-alias-perl 1.28-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 368 kB
  • sloc: perl: 1,976; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 294 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings qw( FATAL all NONFATAL void );
use lib 'lib';
use Test::More tests => 4;

use Data::Alias;

our $x = "x";
my $xref = "@{[\$x]}";
our $y = "y";
my $yref = "@{[\$y]}";
alias { ($x, $y) = ($y, $x) };
is $x, "y";
is $y, "x";
is "@{[\$x]}", $yref;
is "@{[\$y]}", $xref;

1;