From: Joel E. Denny Date: Thu, 27 Aug 2009 07:52:53 +0000 (-0400) Subject: tests: use perl for printing special sequences to files. X-Git-Tag: v2.4.1a~25 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/4d7b57b52739d4405c6ad44b48c5047b4c32510a tests: use perl for printing special sequences to files. And skip tests if perl is not available. This is better than playing tricks with shell portability. Suggested by Akim Demaille. * tests/input.at (Bad escapes in literals): Use it here for special characters. (cherry picked from commit b70c7fb4e1db54e78d4f3d4a0f110a81118ffc60) Conflicts: tests/input.at --- diff --git a/ChangeLog b/ChangeLog index 611091b4..1e9ce511 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-27 Joel E. Denny + + tests: use perl for printing special sequences to files. + And skip tests if perl is not available. This is better than + playing tricks with shell portability. Suggested by Akim + Demaille. + * tests/input.at (Bad character literals): Use it here for + omitting final newlines. + (Bad escapes in literals): Use it here for special characters. + 2009-08-21 Joel E. Denny Use locale when quoting. diff --git a/tests/input.at b/tests/input.at index 1a63d7e8..be84f9cf 100644 --- a/tests/input.at +++ b/tests/input.at @@ -953,7 +953,13 @@ start: '\777' '\0' '\xfff' '\x0' '\uffff' '\u0000' '\Uffffffff' '\U00000000' '\ ' '\A'; ]]) -echo 'start: "\T\F\0\1" ;' | tr 'TF01' '\011\014\0\1' >> input.y + +# It is not easy to create special characters, we cannot even trust tr. +# Beside we cannot even expect "echo '\0'" to output two characters +# (well three with \n): at least Bash 3.2 converts the two-character +# sequence "\0" into a single NUL character. +AT_CHECK([[perl -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \ + || exit 77]]) AT_BISON_CHECK([input.y], [1], [], [[input.y:2.9-12: invalid number after \-escape: 777