]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Prefer 'cat <<\EOF' to 'cat <<EOF' whenever possible.
authorBruno Haible <bruno@clisp.org>
Tue, 4 Mar 2025 15:50:35 +0000 (16:50 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 4 Mar 2025 15:50:35 +0000 (16:50 +0100)
Rationale: Not interpreting $ and \ in the here documents is a better default
than interpreting them.

* gettext-tools/tests/xgettext-*: Write 'cat <<\EOF' instead of 'cat <<EOF',
when no shell dollar-substitution and backslash-interpretation is needed.

gettext-tools/tests/xgettext-rust-1
gettext-tools/tests/xgettext-rust-4
gettext-tools/tests/xgettext-rust-5
gettext-tools/tests/xgettext-rust-6
gettext-tools/tests/xgettext-rust-7

index b9e088e94e5fdc383591a37e05bf5ba40a1227e9..234019abc1c1542cfb88c4b7b9d29b7c31b28c29 100755 (executable)
@@ -3,7 +3,7 @@
 
 # Test Rust support: Simple things.
 
-cat <<EOF > xg-rs-1.rs
+cat <<\EOF > xg-rs-1.rs
 use gettext_rs::gettext;
 
 pub trait TestCase {
@@ -34,7 +34,7 @@ EOF
 ${XGETTEXT} --omit-header --no-location -k'gettext!' -c -d xg-rs-1.tmp xg-rs-1.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-1.tmp.po > xg-rs-1.po || Exit 1
 
-cat <<EOF > xg-rs-1.ok
+cat <<\EOF > xg-rs-1.ok
 #. standard usage
 msgid "Test String 1"
 msgstr ""
index 3183a57707e71abc09c9b7b719a0733ea9a002f2..9d85b8403309912e1f582f780d38ee4d700b93fd 100755 (executable)
@@ -3,7 +3,7 @@
 
 # Test Rust support: plurals.
 
-cat <<EOF > xg-rs-4.rs
+cat <<\EOF > xg-rs-4.rs
 pub trait TestCase {
   fn main () {
     ngettext("test 1", "plural test");
@@ -17,7 +17,7 @@ ${XGETTEXT} --omit-header --no-location --keyword=myngettext:2,3 \
   -d xg-rs-4.tmp xg-rs-4.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-4.tmp.po > xg-rs-4.po || Exit 1
 
-cat <<EOF > xg-rs-4.ok
+cat <<\EOF > xg-rs-4.ok
 msgid "test 1"
 msgid_plural "plural test"
 msgstr[0] ""
index be3ec074cebefae9ec4e7b080dad91871b07844b..d55bfa48845929a3dd72101ffdb7ed3df1fee39e 100755 (executable)
@@ -12,7 +12,7 @@ EOF
 ${XGETTEXT} --omit-header --no-location -d xg-rs-5.tmp xg-rs-5.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-5.tmp.po > xg-rs-5.po || Exit 1
 
-cat <<EOF > xg-rs-5.ok
+cat <<\EOF > xg-rs-5.ok
 msgid "help"
 msgstr ""
 
index d8c352ae0a3916b575b6d25094f51810603c61c4..307822cd06a6ad5f00f60f5ece294afae6d644d0 100755 (executable)
@@ -18,7 +18,7 @@ EOF
 ${XGETTEXT} --omit-header --no-location -d xg-rs-6a.tmp xg-rs-6.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-6a.tmp.po > xg-rs-6a.po || Exit 1
 
-cat <<EOF > xg-rs-6a.ok
+cat <<\EOF > xg-rs-6a.ok
 msgid "Hello1"
 msgstr ""
 
@@ -33,7 +33,7 @@ ${DIFF} xg-rs-6a.ok xg-rs-6a.po || exit 1
 ${XGETTEXT} --omit-header --no-location -k'tr!' -d xg-rs-6b.tmp xg-rs-6.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-6b.tmp.po > xg-rs-6b.po || Exit 1
 
-cat <<EOF > xg-rs-6b.ok
+cat <<\EOF > xg-rs-6b.ok
 #, rust-format
 msgid "Hello {}"
 msgstr ""
index f892d2948378a723377a1ed54f9375993f33636e..6b3c49df3f65f2a1d1d8742c366e523b38546ba7 100755 (executable)
@@ -59,7 +59,7 @@ EOF
 ${XGETTEXT} --omit-header --no-location --flag=format:1:rust-format -d xg-rs-7.tmp xg-rs-7.rs || Exit 1
 LC_ALL=C tr -d '\r' < xg-rs-7.tmp.po > xg-rs-7.po || Exit 1
 
-cat <<EOF > xg-rs-7.ok
+cat <<\EOF > xg-rs-7.ok
 msgid "Hello10"
 msgstr ""