File: 03_random_string.t

package info (click to toggle)
libstring-random-perl 1%3A0.29-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 168 kB
  • ctags: 14
  • sloc: perl: 347; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use warnings;

use Test::More tests => 4;

# 1: Make sure we can load the module
BEGIN { use_ok('String::Random', ':all'); }

# 2: Make sure we can create a new object
my $foo=new String::Random;
ok(defined($foo), "new()");

# 3: Test function interface to randpattern()
my $abc=random_string("012", ['a'], ['b'], ['c']);
is($abc, 'abc', "random_string()");

# 4: Make sure the function didn't pollute $foo
ok(!defined($foo->{'0'}), "pollute object");

# vi: set ai et syntax=perl: