File: 17_nsclean.t

package info (click to toggle)
libdata-util-perl 0.67-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 556 kB
  • sloc: perl: 2,958; ansic: 416; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!perl -w

use strict;
use Test::More tests => 10;
use Test::Exception;

use FindBin qw($Bin);
use lib "$Bin/lib";

{
	package Foo;
	use NSClean;

	::ok foo(), 'foo';
	::ok bar(), 'bar';
	::ok baz(), 'baz';

	our $foo = 'a';
	our @foo = 'b';
	our %foo = (c => 'd');
}

ok exists $Foo::{foo}, '*Foo::foo exists';

is_deeply eval q{\\$Foo::foo}, \'a';
is_deeply eval q{\\@Foo::foo}, ['b'];
is_deeply eval q{\\%Foo::foo}, {c => 'd'};

is(Foo->can('foo'), undef);
is(Foo->can('bar'), undef);
is(Foo->can('baz'), \&Foo::baz);