Changeset 15027
- Timestamp:
- Sep 25, 2007, 2:44:43 PM (19 years ago)
- Location:
- trunk/DataStore
- Files:
-
- 2 edited
-
lib/DataStore/File/Parser.pm (modified) (2 diffs)
-
t/03_file_parse.t (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/lib/DataStore/File/Parser.pm
r15022 r15027 1 1 # Copyright (C) 2006 Joshua Hoblitt 2 2 # 3 # $Id: Parser.pm,v 1.1 3 2007-09-25 23:52:46jhoblitt Exp $3 # $Id: Parser.pm,v 1.14 2007-09-26 00:44:43 jhoblitt Exp $ 4 4 5 5 package DataStore::File::Parser; … … 94 94 95 95 }, 96 default => 'http://example.org/ ',96 default => 'http://example.org/index.txt', 97 97 }, 98 98 }, 99 99 ); 100 100 101 my $self = bless \%p, ref $class || $class; 101 my $self = bless {}, ref $class || $class; 102 103 $p{base_uri} =~ qr|(.*?/)index.txt|; 104 $self->{base_uri} = $1; 102 105 103 106 return $self; -
trunk/DataStore/t/03_file_parse.t
r6606 r15027 3 3 # Copyright (C) 2006 Joshua Hoblitt 4 4 # 5 # $Id: 03_file_parse.t,v 1. 4 2006-03-16 21:51:46jhoblitt Exp $5 # $Id: 03_file_parse.t,v 1.5 2007-09-26 00:44:43 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use lib qw( ./lib ./t ); 11 11 12 use Test::More tests => 46;12 use Test::More tests => 50; 13 13 use Test::Warn; 14 14 … … 147 147 148 148 isa_ok(@$results[0], 'DataStore::File'); 149 is(@$results[0]->uri, 'http://example.org/otis0123456.01', 'correct uri'); 149 150 is(@$results[0]->fileid, 'otis0123456.01', 'correct fileid'); 150 151 is(@$results[0]->bytes, '83002312', 'correct datetime'); … … 153 154 154 155 isa_ok(@$results[1], 'DataStore::File'); 156 is(@$results[1]->uri, 'http://example.org/otis0123456.02', 'correct uri'); 155 157 is(@$results[1]->fileid, 'otis0123456.02', 'correct fileid'); 156 158 is(@$results[1]->bytes, '83002312', 'correct datetime'); … … 159 161 160 162 isa_ok(@$results[2], 'DataStore::File'); 163 is(@$results[2]->uri, 'http://example.org/otis0123456.03', 'correct uri'); 161 164 is(@$results[2]->fileid, 'otis0123456.03', 'correct fileid'); 162 165 is(@$results[2]->bytes, '83002312', 'correct datetime'); … … 165 168 166 169 isa_ok(@$results[3], 'DataStore::File'); 170 is(@$results[3]->uri, 'http://example.org/otis0123456.04', 'correct uri'); 167 171 is(@$results[3]->fileid, 'otis0123456.04', 'correct fileid'); 168 172 is(@$results[3]->bytes, '83002312', 'correct datetime');
Note:
See TracChangeset
for help on using the changeset viewer.
