Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgcat-7
1 #! /bin/sh
2
3 # Verify 'msgcat --sort-output'
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mcat-test7.in1"
9 cat <<EOF > mcat-test7.in1
10 #: clients/inst_language.ycp:119
11 msgid "two"
12 msgstr "2"
13
14 #: clients/inst_language.ycp:108
15 msgid ""
16 "one"
17 msgstr ""
18 "1"
19 EOF
20
21 tmpfiles="$tmpfiles mcat-test7.tmp mcat-test7.out"
22 rm -f mcat-test7.tmp
23 : ${MSGCAT=msgcat}
24 ${MSGCAT} --sort-output -o mcat-test7.tmp mcat-test7.in1
25 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
26 LC_ALL=C tr -d '\r' < mcat-test7.tmp > mcat-test7.out
27 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28
29 tmpfiles="$tmpfiles mcat-test7.ok"
30 cat << EOF > mcat-test7.ok
31 #: clients/inst_language.ycp:108
32 msgid "one"
33 msgstr "1"
34
35 #: clients/inst_language.ycp:119
36 msgid "two"
37 msgstr "2"
38 EOF
39
40 : ${DIFF=diff}
41 ${DIFF} mcat-test7.ok mcat-test7.out
42 result=$?
43
44 rm -fr $tmpfiles
45
46 exit $result