1# This file is part of xenv -*- autotest -*- 2# Copyright (C) 2021 Sergey Poznyakoff 3# 4# Xenv is free software; you can redistribute it and/or modify it 5# under the terms of the GNU General Public License as published by the 6# Free Software Foundation; either version 3 of the License, or (at your 7# option) any later version. 8# 9# Xenv is distributed in the hope that it will be useful, 10# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12# GNU General Public License for more details. 13# 14# You should have received a copy of the GNU General Public License along 15# with xenv. If not, see <http://www.gnu.org/licenses/>. */ 16 17AT_SETUP([Quoting]) 18AT_DATA([input],[ 19Anything appearing between \$( and ) is quoted. 20Quoted $(text keeps track of (balanced ()) parentheses to 21find the right closing) one. 22$(Unbalanced parentheses should not appear in quoted text. 23 24No variable expansion occurs within quotes, e.g.: $X. 25 26Preprocessed statements and comments are retained as well: 27 28 $$ifset X 29 30 ${* comment *} 31 32After closing parenthesis, normal preprocessing is restored:) $X. 33]) 34 35AT_CHECK([X=TEXT xenv input], 36[0], 37[ 38Anything appearing between $( and ) is quoted. 39Quoted text keeps track of (balanced ()) parentheses to 40find the right closing one. 41Unbalanced parentheses should not appear in quoted text. 42 43No variable expansion occurs within quotes, e.g.: $X. 44 45Preprocessed statements and comments are retained as well: 46 47 $$ifset X 48 49 ${* comment *} 50 51After closing parenthesis, normal preprocessing is restored: TEXT. 52]) 53 54AT_CLEANUP 55