File: test

package info (click to toggle)
potool 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 248 kB
  • sloc: ansic: 718; yacc: 452; sh: 290; perl: 51; makefile: 49
file content (49 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (3)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -e
set -x

function potool_test()
{
	local dir="$1"
	local desc="$2"
	local opts="$3"
	local out="$4"
	if [ -z "$out" ]; then out="in.po"; fi

	rm -f $dir/out.po
	echo TESTING $dir with "$desc"
	${WRAPPER} ../potool $opts $dir/in.po > $dir/out.po
	diff -u "$dir/$out" $dir/out.po
	rm -f $dir/out.po
}

potool_test 1 "no filter" ""
(cd 1 && ls -1 | egrep -v '^(in.po|CVS)$') | while read out; do
	potool_test 1 "-${out/.po}" "-${out/.po}" "$out"
done

for dir in 2
do
	echo TESTING $dir/work.po
	${WRAPPER} ../potool $dir/in.po $dir/work.po > $dir/out.po
	diff -u $dir/work.po $dir/out.po
	rm -f $dir/out.po
done

function poedit_test()
{
	local dir="$1"; shift
	local desc="$1"; shift
	local opts="$1"; shift

	echo TESTING $dir with "$desc"
	cp $dir/in.po $dir/work.po
	PATH="$(pwd)/../scripts:$(pwd)/../:$PATH" EDITOR=: poedit $opts $dir/work.po
	diff -u $dir/in.po $dir/work.po
	rm -f $dir/work.po
}

poedit_test 3 "no options" ""
poedit_test 3 "-a" "-a"

poedit_test 4-wrapping "-p" "-p"