Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcmp-3
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test a failing comparison with Java .properties syntax.
5
6 cat <<EOF > mc-test3.in1
7 one=first
8 two=second
9 three=third
10 four=fourth
11 EOF
12
13 cat <<EOF > mc-test3.in2
14 !thre=
15 !one=
16 !two=
17 EOF
18
19 : ${MSGCMP=msgcmp}
20 LC_MESSAGES=C LC_ALL= \
21 ${MSGCMP} --properties-input mc-test3.in1 mc-test3.in2 2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgcmp\.exe|msgcmp|' -e 's|^msgcmp\.exe|msgcmp|' | LC_ALL=C tr -d '\r' > mc-test3.out
22
23 cat <<EOF > mc-test3.ok
24 mc-test3.in2:1: this message is used but not defined...
25 mc-test3.in1:3: ...but this definition is similar
26 mc-test3.in1:4: warning: this message is not used
27 msgcmp: found 1 fatal error
28 EOF
29
30 : ${DIFF=diff}
31 ${DIFF} mc-test3.ok mc-test3.out
32 result=$?
33
34 exit $result