]>
iEval git - slob.git/blob - t/Slob.t
5 use Test
::More tests
=> 25;
6 BEGIN { use_ok
('Slob') };
8 for my $path (<t
/freedict
-*.slob
>) {
9 note
"Now using $path";
10 my $slob = Slob
->new($path);
12 my $nr_of_entries = $slob->ref_count;
14 my $second_ref = $slob->seek_and_read_ref(4);
15 my $bin = $slob->seek_and_read_storage_bin($second_ref->{bin_index
});
17 is
$second_ref->{key
}, 'abacus';
18 is
$second_ref->{bin_index
}, 0;
19 is
$second_ref->{item_index
}, 161;
20 my $count = scalar @
{$bin->{positions
}};
23 my $expected = <<'EOF';
24 <html><head><link href="~/css/default.css" rel="stylesheet" type="text/css"><link href="~/css/night.css" rel="alternate stylesheet" title="Night" type="text/css"></head><script src="~/js/styleswitcher.js"></script><body><div class="form">
25 <div class="orth">abacus</div><div class="pron">æbəkəs</div></div><ol class="sense single"><li class="sense">
26 <ol class="cit single"><li class="cit trans">
27 <ol class="quote single"><li class="quote">Rechenbrett</li></ol><div class="gramGrp">
28 <div class="gen">m</div></div></li></ol></li></ol></body></html>
31 is
$slob->get_entry_of_storage_bin($bin, $second_ref->{item_index
}), $expected;
33 is
$slob->seek_and_read_ref_and_data(4)->{data
}, $expected;
This page took 0.049959 seconds and 4 git commands to generate.