Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test reading in NeXTstep/GNUstep .strings syntax.
      4 
      5 tmpfiles=""
      6 trap 'rm -fr $tmpfiles' 1 2 3 15
      7 
      8 tmpfiles="$tmpfiles mcat-s-1.in"
      9 cat <<\EOF > mcat-s-1.in
     10 /* This is an example of a string table file. Everything inside a comment
     11 is completely ignored, even if in "quotes", or \escape characters, etc.
     12 */
     13 
     14 "title"	= "pattern II target 1";
     15 
     16 /* This is an example of excape codes in the string table, codes */
     17 /* that are not one of abfnrtv are stripped of the \ character */
     18 "escapes"    = "This is a tab \t and a return \n or a \a but not a \p";
     19 "escapes2"    = "Well how about a \0? Guess not.";
     20 
     21 /* more parameters, white space between tokens is ignored */
     22 "actualSize"	
     23 	= 
     24 		"0.000250 0.000250";
     25 
     26 /* a key with no value assumes the value is the empty string */
     27 "hoe322070.element";
     28 EOF
     29 
     30 tmpfiles="$tmpfiles mcat-s-1.out mcat-s-1.err"
     31 rm -f mcat-s-1.out
     32 : ${MSGCAT=msgcat}
     33 LC_MESSAGES=C LC_ALL= \
     34 ${MSGCAT} --stringtable-input -o mcat-s-1.out mcat-s-1.in >mcat-s-1.err 2>&1
     35 result=$?
     36 cat mcat-s-1.err | grep -v ': internationalized messages'
     37 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
     38 
     39 tmpfiles="$tmpfiles mcat-s-1.ok"
     40 cat << \EOF > mcat-s-1.ok
     41 # This is an example of a string table file. Everything inside a comment
     42 # is completely ignored, even if in "quotes", or \escape characters, etc.
     43 #
     44 msgid "title"
     45 msgstr "pattern II target 1"
     46 
     47 # This is an example of excape codes in the string table, codes
     48 # that are not one of abfnrtv are stripped of the \ character
     49 msgid "escapes"
     50 msgstr ""
     51 "This is a tab \t and a return \n"
     52 " or a \a but not a p"
     53 
     54 msgid "escapes2"
     55 msgstr "Well how about a "
     56 
     57 # more parameters, white space between tokens is ignored
     58 msgid "actualSize"
     59 msgstr "0.000250 0.000250"
     60 
     61 # a key with no value assumes the value is the empty string
     62 msgid "hoe322070.element"
     63 msgstr ""
     64 EOF
     65 
     66 : ${DIFF=diff}
     67 ${DIFF} mcat-s-1.ok mcat-s-1.out
     68 result=$?
     69 
     70 rm -fr $tmpfiles
     71 
     72 exit $result
     73