# This file is part of Eclat -*- Autotest -*- # Copyright (C) 2012-2021 Sergey Poznyakoff # # Eclat 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. # # Eclat 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 Eclat. If not, see . AT_SETUP([parse tree]) AT_KEYWORDS([forlan forlan01]) AT_DATA([input],[// test format for DescribeTags if (.DescribeTagsResponse) { if (.DescribeTagsResponse.tagSet.item.resourceId[[i-deadbeef]] && parent(last).key[[hostname]]) print(parent(last).value); } else if (.Response.Errors) error(.Response.Errors.Error.Message); else dump(.); ]) AT_CHECK([tforlan -D input], [0], [0001: COND 0002: NODE 0003: COMP.DescribeTagsResponse 0004: IFTRUE 0001 0005: COND 0006: AND 0007: NODE 0008: COMP.DescribeTagsResponse.tagSet.item.resourceId[[i-deadbeef]] 0009: NODE 0010: COMP 0011: ROOT 0012: CALL: parent 0013: LAST 0014: COMP: .key[[hostname]] 0015: IFTRUE 0005 0016: CALL: print 0017: COMP 0018: ROOT 0019: CALL: parent 0020: LAST 0021: COMP: .value 0022: IFFALSE 0005 0023: IFFALSE 0001 0024: COND 0025: NODE 0026: COMP.Response.Errors 0027: IFTRUE 0024 0028: CALL: error 0029: COMP.Response.Errors.Error.Message 0030: IFFALSE 0024 0031: CALL: dump 0032: COMP ]) AT_CLEANUP