summaryrefslogtreecommitdiffabout
path: root/tests/forlan01.at
Unidiff
Diffstat (limited to 'tests/forlan01.at') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/forlan01.at77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/forlan01.at b/tests/forlan01.at
new file mode 100644
index 0000000..cf826e9
--- a/dev/null
+++ b/tests/forlan01.at
@@ -0,0 +1,77 @@
1# This file is part of Eclat -*- Autotest -*-
2# Copyright (C) 2012 Sergey Poznyakoff
3#
4# Eclat is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# Eclat 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
15# along with Eclat. If not, see <http://www.gnu.org/licenses/>.
16
17AT_SETUP([dump])
18AT_KEYWORDS([forlan forlan01])
19
20AT_DATA([input],[// test format for DescribeTags
21if (.DescribeTagsResponse) {
22 if (.DescribeTagsResponse.tagSet.item.resourceId[[i-deadbeef]] &&
23 parent(last).key[[hostname]])
24 print(parent(last).value);
25} else if (.Response.Errors)
26 error(.Response.Errors.Error.Message);
27else
28 dump();
29])
30
31AT_CHECK([tforlan -D input],
32[0],
33[0001: COND
340002: NODE
350003: COMP ABS
360004: LIT: "DescribeTagsResponse"
370005: IFTRUE 0001
380006: COND
390007: AND
400008: NODE
410009: COMP ABS
420010: LIT: "DescribeTagsResponse"
430011: LIT: "tagSet"
440012: LIT: "item"
450013: TEST: resourceId[[i-deadbeef]]
460014: NODE
470015: COMP
480016: CALL: parent
490017: LAST
500018: TEST: key[[hostname]]
510019: IFTRUE 0006
520020: CALL: print
530021: COMP
540022: CALL: parent
550023: LAST
560024: LIT: "value"
570025: IFFALSE 0006
580026: IFFALSE 0001
590027: COND
600028: NODE
610029: COMP ABS
620030: LIT: "Response"
630031: LIT: "Errors"
640032: IFTRUE 0027
650033: CALL: error
660034: COMP ABS
670035: LIT: "Response"
680036: LIT: "Errors"
690037: LIT: "Error"
700038: LIT: "Message"
710039: IFFALSE 0027
720040: CALL: dump
73])
74
75AT_CLEANUP
76
77

Return to:

Send suggestions and report system problems to the System administrator.