/[SWISH-Split]/trunk/t/SWISH-Split.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/SWISH-Split.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Sun Aug 8 10:09:55 2004 UTC (19 years, 7 months ago) by dpavlin
File MIME type: application/x-troff
File size: 874 byte(s)
initial import of SWISH::Split. Lot of documentation, less code.

1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use Test::More tests => 9;
6 use Test::Exception;
7 use File::Temp qw/ :mktemp /;
8 use blib;
9
10 BEGIN { use_ok('SWISH::Split') };
11
12 my %param;
13
14 throws_ok { SWISH::Split->open(%param) } qr/slice_name/, "slice_name";
15
16 sub slice_1st_char {
17 return substr($_[0],0,1);
18 };
19
20 use Data::Dumper;
21 print Dumper(\&slice_1st_char);
22
23 $param{'slice_name'} = \&slice_1st_char;
24 throws_ok { SWISH::Split->open(%param) } qr/slices/, "slices";
25
26 $param{'slices'} = 3;
27 throws_ok { SWISH::Split->open(%param) } qr/index/, "index";
28
29 ok($param{'index'} = mkstemp("/tmp/swishXXXXX"), "make temp index");
30 throws_ok { SWISH::Split->open(%param) } qr/dir/, "dir";
31
32 ok($param{'index'} = mkdtemp("/tmp/swishXXXXX"), "make temp index");
33 ok(my $i=SWISH::Split->open(%param), "open");
34
35 # methods test
36
37
38
39 # internal functions test
40
41 cmp_ok($i->in_slice("swishpath"), '==', 2, "open");
42

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26