X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/df09ef2e8fc03de1bc17e9687fddd5f2ed86662c..52d9d4112f9fa2f0403da386d9346f1ccffc818b:/tests/input.at diff --git a/tests/input.at b/tests/input.at index 1b89d737..838dbe89 100644 --- a/tests/input.at +++ b/tests/input.at @@ -1,5 +1,5 @@ # Checking the Bison scanner. -*- Autotest -*- -# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2005 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 @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. AT_BANNER([[Input Processing.]]) @@ -25,7 +25,7 @@ AT_BANNER([[Input Processing.]]) ## Invalid $n. ## ## ------------ ## -AT_SETUP([Invalid $n]) +AT_SETUP([Invalid dollar-n]) AT_DATA([input.y], [[%% @@ -132,7 +132,7 @@ AT_SETUP([Torturing the Scanner]) AT_DATA([input.y], []) AT_CHECK([bison input.y], [1], [], -[[input.y:1.1: syntax error, unexpected "end of file" +[[input.y:1.1: syntax error, unexpected end of file ]]) @@ -272,3 +272,49 @@ AT_PARSER_CHECK([./input], 0, ]]) AT_CLEANUP + + +## ---------------------- ## +## Typed symbol aliases. ## +## ---------------------- ## + +AT_SETUP([Typed symbol aliases]) + +# Bison 2.0 broke typed symbol aliases - ensure they work. + +AT_DATA_GRAMMAR([input.y], +[[%union +{ + int val; +}; +%token MY_TOKEN "MY TOKEN" +%type exp +%% +exp: "MY TOKEN"; +%% +]]) + +AT_CHECK([bison -o input.c input.y]) + +AT_CLEANUP + + +## --------- ## +## Require. ## +## --------- ## + +m4_define([AT_CHECK_REQUIRE], +[AT_SETUP([Require $1]) +AT_DATA_GRAMMAR([input.y], +[[%require "$1"; +%% +empty_file:; +]]) +AT_CHECK([bison -o input.c input.y], $2, [], ignore) +AT_CLEANUP +]) + +AT_CHECK_REQUIRE(1.0, 0) +AT_CHECK_REQUIRE(AT_PACKAGE_VERSION, 0) +## FIXME: Some day augment this version number. +AT_CHECK_REQUIRE(100.0, 1)