File: 07baddicts.t

package info (click to toggle)
libdata-phrasebook-perl 0.35-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 1,242; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (4)
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
41
42
#!/usr/bin/perl -w
use strict;

use Test::More tests => 7;
use Data::Phrasebook;

my @empty = ();

# load up the default dict
my $book = Data::Phrasebook->new(class  => 'Plain',
                                 loader => 'Text',
								 );

{
	my @dicts = $book->dicts();
	is( scalar(@dicts), 0 );

	@dicts = $book->dicts('blah');
	is( scalar(@dicts), 0 );
}

$book->file('t/phrases');

{
	eval { $book->keywords('t/phrases','welsh.txt'); };
	like( $@, qr/not accessible/ );

	eval { $book->keywords('blah','english.txt'); };
	like( $@, qr/not accessible/ );
}

{
	eval { $book->keywords(undef,'welsh.txt'); };
	like( $@, qr/not accessible/ );

	eval { $book->keywords('t/phrases',undef); };
	like( $@, qr/not accessible/ );

	eval { $book->keywords('blah',undef); };
	like( $@, qr/not accessible/ );
}