CVSROOT: /sources/m4 Module name: m4 Changes by: Eric Blake <ericb> 06/07/07 15:47:39
Index: tests/freeze.at =================================================================== RCS file: tests/freeze.at diff -N tests/freeze.at --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/freeze.at 7 Jul 2006 15:47:39 -0000 1.1 @@ -0,0 +1,104 @@ +# Hand crafted tests for GNU M4. -*- Autotest -*- +# Copyright 2006 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + + +AT_BANNER([Freezing state.]) + +## ---------------- ## +## loading format 1 ## +## ---------------- ## + +AT_SETUP([loading format 1]) +AT_KEYWORDS([frozen]) + +m4_if([ +Note: frozen.m4f was obtained by deleting unneeded lines from the output of +a version of m4 1.4.5 with changeword support. Deleting lines is in effect +equivalent to using undefine(name) in the input. This test ensures we +behave well with the old format, including \ parsing, disappearing builtins +(okay so long as the input does not try to use them), and restoring sane +defaults for features that were only added in version 2 frozen format. + +$ m4 --version | head -n1 +GNU M4 1.4.5 +$ cat frozen.m4 +divert(`-1') +define(`foo', `\FOO') +pushdef(`foo', `bar') +define(`my_define', defn(`define')) +define(`my_changeword', defn(`changeword')) +pushdef(`my_define', `define') +pushdef(`my_define', defn(`define')) +divert(`1')dnl +foo +divert`'dnl +changequote([,])dnl +changecom([/*], [*/])dnl +dnl Implied sequence of undefine(`name') due to hand-edits +$ m4 -F frozen.m4f frozen.m4 +$ +]) +AT_DATA([frozen.m4f], +[[# This is a frozen state file generated by GNU M4 1.4.5 +V1 +Q1,1 +[] +C2,2 +/**/ +F6,6 +popdefpopdef +F13,10 +my_changewordchangeword +F9,6 +my_definedefine +T9,6 +my_definedefine +F9,6 +my_definedefine +T3,4 +foo\FOO +T3,3 +foobar +F3,3 +dnldnl +D1,4 +bar + +D0,0 + +# End of frozen state file +]]) + +AT_DATA([input.m4], +[[foo /* foo */ popdef([foo])foo +my_define([bar], [1])[]popdef([my_define]) bar +my_define([bar], [2])[]popdef([my_define]) bar +my_define([bar], [3])[]popdef([my_define]) bar +my_define([bar], [4])[]popdef([my_define]) bar +]]) + +AT_CHECK_M4([-R frozen.m4f input.m4], [0], +[[bar /* foo */ \FOO + 1 +define 1 + 3 +my_define(bar, 4) 3 +bar +]]) + +AT_CLEANUP
