-rw-r--r-- | tests/forlan01.at | 77 |
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 | |||
17 | AT_SETUP([dump]) | ||
18 | AT_KEYWORDS([forlan forlan01]) | ||
19 | |||
20 | AT_DATA([input],[// test format for DescribeTags | ||
21 | if (.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); | ||
27 | else | ||
28 | dump(); | ||
29 | ]) | ||
30 | |||
31 | AT_CHECK([tforlan -D input], | ||
32 | [0], | ||
33 | [0001: COND | ||
34 | 0002: NODE | ||
35 | 0003: COMP ABS | ||
36 | 0004: LIT: "DescribeTagsResponse" | ||
37 | 0005: IFTRUE 0001 | ||
38 | 0006: COND | ||
39 | 0007: AND | ||
40 | 0008: NODE | ||
41 | 0009: COMP ABS | ||
42 | 0010: LIT: "DescribeTagsResponse" | ||
43 | 0011: LIT: "tagSet" | ||
44 | 0012: LIT: "item" | ||
45 | 0013: TEST: resourceId[[i-deadbeef]] | ||
46 | 0014: NODE | ||
47 | 0015: COMP | ||
48 | 0016: CALL: parent | ||
49 | 0017: LAST | ||
50 | 0018: TEST: key[[hostname]] | ||
51 | 0019: IFTRUE 0006 | ||
52 | 0020: CALL: print | ||
53 | 0021: COMP | ||
54 | 0022: CALL: parent | ||
55 | 0023: LAST | ||
56 | 0024: LIT: "value" | ||
57 | 0025: IFFALSE 0006 | ||
58 | 0026: IFFALSE 0001 | ||
59 | 0027: COND | ||
60 | 0028: NODE | ||
61 | 0029: COMP ABS | ||
62 | 0030: LIT: "Response" | ||
63 | 0031: LIT: "Errors" | ||
64 | 0032: IFTRUE 0027 | ||
65 | 0033: CALL: error | ||
66 | 0034: COMP ABS | ||
67 | 0035: LIT: "Response" | ||
68 | 0036: LIT: "Errors" | ||
69 | 0037: LIT: "Error" | ||
70 | 0038: LIT: "Message" | ||
71 | 0039: IFFALSE 0027 | ||
72 | 0040: CALL: dump | ||
73 | ]) | ||
74 | |||
75 | AT_CLEANUP | ||
76 | |||
77 | |||