# This file is part of Mailfromd testsuite. -*- Autotest -*- # Copyright (C) 2007-2020 Sergey Poznyakoff # # 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 3, 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, see . AT_SETUP([variable shadowing]) AT_KEYWORDS([variable variables shadow]) MF_CHECK_TEXT([ set x "initial" func foo(string x) returns string do return x done func bar(string y) returns string do string x set x "%y text" return x done prog envfrom do echo foo("param") echo bar("auto") echo x done ], [], [EX_OK], [State envfrom: continue ], [mailfromd: prog:4.17: warning: parameter `x' is shadowing a global mailfromd: prog:11.10: warning: automatic variable `x' is shadowing a global param auto text initial ]) AT_CLEANUP