File: 24_alias_cond.t

package info (click to toggle)
libdata-alias-perl 1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: perl: 1,976; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 275 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w

use strict;
use warnings qw( FATAL all NONFATAL void );
use lib 'lib';
use Test::More tests => 6;

use Data::Alias;

for (0, 1) {
	my ($x, $y, $z);

	is \alias($_ ? $y : $z = $x), \$x;
	is $_ ? \$y : \$z, \$x;
	isnt $_ ? \$z : \$y, \$x;
}

# vim: ft=perl