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 b70c7fb4e1)

Conflicts:

	tests/input.at
This commit is contained in:
Joel E. Denny
2009-08-27 03:52:53 -04:00
parent 321fe707f4
commit 4d7b57b527
2 changed files with 17 additions and 1 deletions

View File

@@ -1,3 +1,13 @@
2009-08-27 Joel E. Denny <jdenny@clemson.edu>
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 <jdenny@clemson.edu>
Use locale when quoting.

View File

@@ -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