m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/tests/freeze.at,v


From: Eric Blake
Subject: Changes to m4/tests/freeze.at,v
Date: Tue, 23 Jan 2007 14:28:25 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      07/01/23 14:28:23

Index: tests/freeze.at
===================================================================
RCS file: /sources/m4/m4/tests/freeze.at,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- tests/freeze.at     31 Aug 2006 03:21:35 -0000      1.8
+++ tests/freeze.at     23 Jan 2007 14:28:23 -0000      1.9
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU M4.                               -*- Autotest -*-
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007 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
@@ -39,7 +39,7 @@
 $ cat frozen.m4
 divert(`-1')
 define(`foo', `\FOO')
-pushdef(`foo', `bar')
+pushdef(`foo', `bar${1}')
 define(`my_define', defn(`define'))
 define(`my_changeword', defn(`changeword'))
 pushdef(`my_define', `define')
@@ -72,12 +72,12 @@
 my_definedefine
 T3,4
 foo\FOO
-T3,3
-foobar
+T3,7
+foobar${1}
 F3,3
 dnldnl
-D1,4
-bar
+D1,8
+bar${1}
 
 D0,0
 
@@ -85,7 +85,7 @@
 ]])
 
 AT_DATA([input.m4],
-[[foo /* foo */ popdef([foo])foo
+[[foo([2]) /* 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
@@ -93,12 +93,12 @@
 ]])
 
 AT_CHECK_M4([-R frozen.m4f input.m4], [0],
-[[bar /* foo */ \FOO
+[[bar${1} /* foo */ \FOO
  1
 define 1
  3
 my_define(bar, 4) 3
-bar
+bar${1}
 ]],
 [[m4:input.m4:5: Warning: popdef: undefined macro `my_define'
 ]])
@@ -106,9 +106,162 @@
 AT_CLEANUP
 
 
-## -------------------------- ##
-## Reloading unknown builtins ##
-## -------------------------- ##
+## ---------------- ##
+## loading format 2 ##
+## ---------------- ##
+
+AT_SETUP([loading format 2])
+AT_KEYWORDS([frozen])
+
+AT_DATA([frozen.m4f],
+[[# Handcrafted file, obeying the version 2 spec
+V2
+# missing close quote should be supplied
+Q1,0
+>
+# missing close comment should be supplied
+C1,0
+<
+M2
+m4
+M3
+gnu
+F7,7,3
+builtinbuiltingnu
+# Testing escape sequences
+T4,5
+blah\t\477\040\X5C
+]])
+
+AT_DATA([input.m4],
+[[< comment: builtin()
+builtin(>define', foo, bar)
+foo
+blah
+]])
+
+AT_CHECK_M4([-R frozen.m4f input.m4], [0],
+[[< comment: builtin()
+
+bar
+       '7 \
+]])
+
+AT_CLEANUP
+
+
+## --------- ##
+## changecom ##
+## --------- ##
+
+AT_SETUP([reloading changecom])
+AT_KEYWORDS([frozen])
+
+# Check that changesyntax is maintained across freeze boundaries.
+
+AT_DATA([[frozen.m4]],
+[[changecom`'changequote(<,>)dnl
+]])
+
+AT_DATA([[unfrozen.m4]],
+[[define(<foo>, <bar>)
+foo # foo
+]])
+
+# First generate the `expout' output by running over the sources before
+# freezing.
+AT_CHECK_M4([frozen.m4 unfrozen.m4], [0],
+           [stdout], [stderr])
+
+mv stdout expout
+mv stderr experr
+
+# Now freeze the first source file.
+AT_CHECK_M4([-F frozen.m4f frozen.m4], [0])
+
+# Now rerun the original sequence, but using the frozen file.
+AT_CHECK_M4([-R frozen.m4f unfrozen.m4], [0],
+           [expout], [experr])
+
+AT_CLEANUP
+
+
+## ------------ ##
+## changesyntax ##
+## ------------ ##
+
+AT_SETUP([reloading changesyntax])
+AT_KEYWORDS([frozen])
+
+# Check that changesyntax is maintained across freeze boundaries.
+
+AT_DATA([[frozen.m4]],
+[[changesyntax(`W+.', `({', `)}')dnl
+define{`a.b', `hello $1'}dnl
+]])
+
+AT_DATA([[unfrozen.m4]],
+[[a.b{world}
+]])
+
+# First generate the `expout' output by running over the sources before
+# freezing.
+AT_CHECK_M4([frozen.m4 unfrozen.m4], [0],
+           [stdout], [stderr])
+
+mv stdout expout
+mv stderr experr
+
+# Now freeze the first source file.
+AT_CHECK_M4([-F frozen.m4f frozen.m4], [0])
+
+# Now rerun the original sequence, but using the frozen file.
+AT_CHECK_M4([-R frozen.m4f unfrozen.m4], [0],
+           [expout], [experr])
+
+AT_CLEANUP
+
+
+## ------------- ##
+## regexp syntax ##
+## ------------- ##
+
+AT_SETUP([reloading regexp syntax])
+AT_KEYWORDS([frozen])
+
+# Check that regular expression syntax is maintained across freeze boundaries.
+
+AT_DATA([[frozen.m4]],
+[[changeresyntax(`POSIX_EXTENDED')dnl
+]])
+
+AT_DATA([[unfrozen.m4]],
+[[regexp(`GNUs not Unix', `\w(\w*)$')
+regexp(`GNUs not Unix', `\w\(\w*\)$', `GNU_M4')
+]])
+
+# First generate the `expout' output by running over the sources before
+# freezing.
+AT_CHECK_M4([frozen.m4 unfrozen.m4], [0],
+           [stdout], [stderr])
+
+mv stdout expout
+mv stderr experr
+
+# Now freeze the first source file.
+AT_CHECK_M4([-F frozen.m4f frozen.m4], [0],
+           [ignore], [ignore])
+
+# Now rerun the original sequence, but using the frozen file.
+AT_CHECK_M4([-R frozen.m4f unfrozen.m4], [0],
+           [expout], [experr])
+
+AT_CLEANUP
+
+
+## ---------------- ##
+## unknown builtins ##
+## ---------------- ##
 
 AT_SETUP([reloading unknown builtin])
 AT_KEYWORDS([frozen])
@@ -158,39 +311,3 @@
 ]])
 
 AT_CLEANUP
-
-## ---------------------- ##
-## Freezing regexp syntax ##
-## ---------------------- ##
-
-AT_SETUP([regexp syntax])
-AT_KEYWORDS([frozen])
-
-# Check that regular expression syntax is maintained across freeze baundaries.
-
-AT_DATA([[frozen.m4]],
-[[changeresyntax(`POSIX_EXTENDED')dnl
-]])
-
-AT_DATA([[unfrozen.m4]],
-[[regexp(`GNUs not Unix', `\w(\w*)$')
-regexp(`GNUs not Unix', `\w\(\w*\)$', `GNU_M4')
-]])
-
-# First generate the `expout' output by running over the sources before
-# freezing.
-AT_CHECK_M4([frozen.m4 unfrozen.m4], 0,
-           [stdout], [stderr])
-
-mv stdout expout
-mv stderr experr
-
-# Now freeze the first source file.
-AT_CHECK_M4([-F frozen.m4f frozen.m4], 0,
-           [ignore], [ignore])
-
-# Now rerun the original sequence, but using the frozen file.
-AT_CHECK_M4([-R frozen.m4f unfrozen.m4], 0,
-           [expout], [experr])
-
-AT_CLEANUP([frozen.m4f])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]