File: 92-export-assertions.t

package info (click to toggle)
libdata-validate-type-perl 1.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: perl: 1,534; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 756 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
#!perl -T

use strict;
use warnings;

use Test::FailWarnings;
use Test::More;


my $expect_exported =
{
	is_string       => 0,
	is_arrayref     => 0,
	is_hashref      => 0,
	is_coderef      => 0,
	is_number       => 0,
	assert_string   => 1,
	assert_arrayref => 1,
	assert_hashref  => 1,
	assert_coderef  => 1,
	assert_number   => 1,
	filter_string   => 0,
	filter_arrayref => 0,
	filter_hashref  => 0,
	filter_coderef  => 0,
	filter_number   => 0,
};

plan( tests => scalar( keys %$expect_exported ) + 1 );

use_ok( 'Data::Validate::Type', ':assertions' );

while ( my ( $function, $exported ) = each( %$expect_exported ) )
{
	is(
		defined( &$function ) ? 1 : 0,
		$exported,
		"Function $function " . ( $exported ? "is" : "isn't") . " imported.",
	);
}