/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by dpavlin, Sun Aug 8 10:09:55 2004 UTC revision 2 by dpavlin, Sun Aug 8 10:27:27 2004 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 9;  use Test::More tests => 11;
6  use Test::Exception;  use Test::Exception;
7  use File::Temp qw/ :mktemp /;  use File::Temp qw/ :mktemp /;
8  use blib;  use blib;
9    
10  BEGIN { use_ok('SWISH::Split') };  BEGIN { use_ok('SWISH::Split') };
11    
12    # FIXME debug
13    system "rm -Rf /tmp/swish?????";
14    
15  my %param;  my %param;
16    
17  throws_ok { SWISH::Split->open(%param) } qr/slice_name/, "slice_name";  throws_ok { SWISH::Split->open(%param) } qr/slice_name/, "slice_name";
# Line 21  use Data::Dumper; Line 24  use Data::Dumper;
24  print Dumper(\&slice_1st_char);  print Dumper(\&slice_1st_char);
25    
26  $param{'slice_name'} = \&slice_1st_char;  $param{'slice_name'} = \&slice_1st_char;
27  throws_ok { SWISH::Split->open(%param) } qr/slices/, "slices";  throws_ok { SWISH::Split->open(%param) } qr/slices/, "need slices";
28    
29  $param{'slices'} = 3;  $param{'slices'} = 3;
30  throws_ok { SWISH::Split->open(%param) } qr/index/, "index";  throws_ok { SWISH::Split->open(%param) } qr/index/, "need index";
31    
32    ok($param{'index'} = mktemp("/tmp/swishXXXXX"), "make temp name");
33    
34    diag "index path: $param{'index'}\n";
35    
36    ok(open(F, "> $param{'index'}"), "touch");
37    close(F);
38    
39    throws_ok { SWISH::Split->open(%param) } qr/dir/, "need dir";
40    
41    ok(unlink($param{'index'}), "rm");
42    
43  ok($param{'index'} = mkstemp("/tmp/swishXXXXX"), "make temp index");  ok(mkdir($param{'index'}), "mkdir");
 throws_ok { SWISH::Split->open(%param) } qr/dir/, "dir";  
44    
 ok($param{'index'} = mkdtemp("/tmp/swishXXXXX"), "make temp index");  
45  ok(my $i=SWISH::Split->open(%param), "open");  ok(my $i=SWISH::Split->open(%param), "open");
46    
47  # methods test  # methods test

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.26