summaryrefslogtreecommitdiffabout
path: root/tests/forlan01.at
blob: 336d2dd1e922b51d699ac0f32489f8bd830de09f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This file is part of Eclat -*- Autotest -*-
# Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>.

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


Return to:

Send suggestions and report system problems to the System administrator.