42 lines · plain
1# Redefine the %{global:greeting} parameter of %{global:echo} before using it.2# The necessary expansion order was established in the test suite config3# (%{global:echo} before %{global:greeting}), and redefining the parameter4# doesn't change that expansion order. That order would be reversed if5# %{global:greeting} were handled as a new substitution, preventing full6# expansion.7#8# REDEFINE: %{global:greeting}=Hello9# RUN: %{global:echo}10# CHECK:# | GLOBAL: Hello World11 12# We can redefine the test suite config's substitutions multiple times. Again,13# the expansion order remains the same (%{global:echo} before %{global:greeting}14# before %{global:what}) but would be reversed if these were handled as new15# substitutions, preventing full expansion.16#17# REDEFINE: %{global:greeting}=Goodbye %{global:what}18# REDEFINE: %{global:what}=Sleep19# RUN: %{global:echo}20# CHECK:# | GLOBAL: Goodbye Sleep Sleep21 22# A new local substitution is prepended to the substitution list so that it can23# depend on all substitutions that were defined previously, including those from24# the test suite config.25#26# DEFINE: %{local:greeting}=Hey %{global:what}27# DEFINE: %{local:echo}=echo "LOCAL: %{local:greeting} %{global:what}"28# RUN: %{local:echo}29# CHECK:# | LOCAL: Hey Sleep Sleep30 31# As for substitutions from the test suite config, redefining local32# substitutions should not change the expansion order. Again, the expansion33# order would be reversed if these were instead handled as new substitutions,34# preventing full expansion.35#36# REDEFINE: %{local:greeting}=So Long %{global:what}37# REDEFINE: %{global:what}=World38# RUN: %{local:echo}39# CHECK:# | LOCAL: So Long World World40 41# CHECK: Passed: 1 {{\([0-9]*.[0-9]*%\)}}42