]> git.saurik.com Git - bison.git/blobdiff - tests/input.at
maint: use announce-gen's new --mail-headers.
[bison.git] / tests / input.at
index 1a63d7e88f82836aab0c935528d580c4aebee875..c65f63b5055c0e0860a072950fe8670ed910ee43 100644 (file)
@@ -1,6 +1,7 @@
 # Checking the Bison scanner.                    -*- Autotest -*-
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software
-# Foundation, Inc.
+
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free
+# Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -702,6 +703,26 @@ AT_BISON_CHECK([input.y], [1], [],
 AT_CLEANUP
 
 
+## ------------------------------- ##
+## %prec's token must be defined.  ##
+## ------------------------------- ##
+
+AT_SETUP([[%prec's token must be defined]])
+
+# According to POSIX, a %prec token must be defined separately.
+
+AT_DATA([[input.y]],
+[[%%
+start: %prec PREC ;
+]])
+
+AT_BISON_CHECK([[input.y]], [[0]], [],
+[[input.y:2.8-17: warning: token for %prec is not defined: PREC
+]])
+
+AT_CLEANUP
+
+
 ## -------------------------------- ##
 ## Reject unused %code qualifiers.  ##
 ## -------------------------------- ##
@@ -953,7 +974,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