File: tok3.test

package info (click to toggle)
htscodecs 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,640 kB
  • sloc: ansic: 15,651; javascript: 2,907; makefile: 330; sh: 184
file content (26 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
out=test.out
if test ! -d $out
then
    mkdir $out
fi

for f in `ls -1 $srcdir/names/*.names $srcdir/htscodecs-corpus/names/*.names 2>/dev/null`
do
    comp=${f%/*/*}/names/tok3/${f##*/}
    for lvl in 1 3 5 7 9 11 13 15 17 19
    do
        printf 'Testing tokenise_name3 -r -%s on %s\t' $lvl "$f"

        # Round trip
        ./tokenise_name3 -r -$lvl < $f > $out/tok3.comp
        wc -c < $out/tok3.comp
        ./tokenise_name3 -d -r < $out/tok3.comp | tr '\000' '\012' > $out/tok3.uncomp
        cmp $f $out/tok3.uncomp || exit 1

        # Precompressed data
        ./tokenise_name3 -d -r < $comp.$lvl | tr '\000' '\012' > $out/tok3.uncomp
        cmp $f $out/tok3.uncomp || exit 1
    done
    echo
done