File: 12badcalls.t

package info (click to toggle)
liblingua-en-namecase-perl 1.21-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 455; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl -w
use strict;

use Lingua::EN::NameCase qw( NameCase nc );
use Test::More  tests => 7;

eval { NameCase() };
like($@,qr/NameCase only accepts/,'.. missing parameters, no error');
eval { NameCase( { 'trent' => 'reznor' } ) };
like($@,qr/Usage/,'.. hash not scalar(ref) or array(ref)');

my $res = 'test';

eval { $res = nc() };
is($@,'','.. missing parameters, no error');
is($res,undef,'.. missing parameters, no result');
eval { nc( { 'trent' => 'reznor' } ) };
like($@,qr/Usage/,'.. hash not scalar(ref)');
eval { nc( [ 'trent', 'reznor' ] ) };
like($@,qr/Usage/,'.. array not scalar(ref)');

eval { nc( 'trent', 'reznor' ) };
like($@,qr/Usage/,'.. mulitple strings not supported');