-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
26 changed files
with
411 additions
and
98 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
tackle/providers/logic/tests/match/block-loop-match-block.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
matcher: blocker | ||
|
||
block->: | ||
for: [1,2] | ||
iter->: "{{item}}" | ||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
foo: bar | ||
rendered->: "{{foo}}" | ||
iter->: "{{item}}" | ||
check->: "{{matches}}" | ||
|
||
block_loop->: | ||
for: [1,2] | ||
iter->: "{{item}}" | ||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
for: [3,4] | ||
foo: bar | ||
rendered->: "{{foo}}" | ||
iter->: "{{item}}" | ||
check->: "{{matches}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
matcher: blocker | ||
|
||
block->: | ||
stuff: things | ||
render_inner->: "{{stuff}}" | ||
render_outer->: "{{matcher}}" | ||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
foo: bar | ||
render_inner->: "{{foo}}" | ||
render_outer->: "{{matcher}}" | ||
check->: "{{matches}}" | ||
|
||
block_loop->: | ||
foo: foo | ||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
for: [3,4] | ||
foo: bar | ||
render_inner->: "{{foo}}" | ||
render_outer->: "{{matcher}}" | ||
iter->: "{{item}}" | ||
check->: "{{matches}}" | ||
|
||
block_loop_output: | ||
matches: | ||
- foo: bar | ||
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
matcher: blocker | ||
|
||
block: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
merge: true | ||
foo: bar | ||
|
||
call: | ||
->: match matcher --merge | ||
case: | ||
blocker->: | ||
bar: bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
matcher: blocker | ||
|
||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
value: True | ||
stuff: things | ||
dict: | ||
stuff->: "{{stuff}}" | ||
list: | ||
- stuff | ||
- things | ||
hook-expanded: | ||
->: literal expanded | ||
hook-compact->: literal compact | ||
|
||
expected: | ||
value: True | ||
stuff: things | ||
dict: | ||
stuff: things | ||
list: | ||
- stuff | ||
- things | ||
hook-expanded: expanded | ||
hook-compact: compact | ||
|
||
assert->: assert "{{matches}}" "{{expected}}" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
matcher: blocker | ||
|
||
matches: | ||
->: match matcher | ||
case: | ||
blocker: | ||
# Should not render | ||
foo->: "{{bar}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
foo: bar | ||
|
||
normal_dict: | ||
->: match foo | ||
case: | ||
->: | ||
foo: bar | ||
blah: blah | ||
bar: bar | ||
|
||
|
||
normal_dict_hook: | ||
->: match foo | ||
case: | ||
->: | ||
foo: bar | ||
stuff: | ||
->: literal things | ||
blah: blah | ||
bar: | ||
foo: foo | ||
stuff: | ||
->: literal stuff | ||
|
||
|
||
#hook_call: | ||
# ->: match foo | ||
# case: | ||
# ->: literal foo | ||
# foo: blah | ||
# bar: bar |
29 changes: 29 additions & 0 deletions
29
tackle/providers/logic/tests/match/default-underscore.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
foo: bar | ||
|
||
normal_str: | ||
->: match foo | ||
case: | ||
_: foo | ||
blah: blah | ||
|
||
normal_dict: | ||
->: match foo | ||
case: | ||
_: | ||
foo: bar | ||
blah: blah | ||
|
||
hook_call: | ||
->: match foo | ||
case: | ||
_->: literal foo | ||
blah: blah | ||
|
||
normal_dict_hook: | ||
->: match foo | ||
case: | ||
_: | ||
foo: bar | ||
stuff: | ||
->: literal things | ||
blah: blah |
14 changes: 14 additions & 0 deletions
14
tackle/providers/logic/tests/match/error-block-loop-merge.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
matcher: blocker | ||
|
||
block_loop_merge->: | ||
foo: foo | ||
matches: | ||
->: match matcher | ||
case: | ||
blocker->: | ||
# Should error because the parent is a map | ||
merge: true | ||
try: true | ||
except: foo | ||
for: [3,4] | ||
foo: bar |
9 changes: 9 additions & 0 deletions
9
tackle/providers/logic/tests/match/error-malformed-regex.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
foo: bar | ||
|
||
error: | ||
->: match foo | ||
case: | ||
blah: blah | ||
'*->': var foo | ||
# Should be this | ||
# '.*->': var foo |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
region: ams | ||
region: r1 | ||
|
||
vms: | ||
->: match region | ||
case: | ||
sng: | ||
- ip: 139 | ||
r0: | ||
- ip: 123 | ||
name: foo | ||
ams: | ||
- ip: 108 | ||
r1: | ||
- ip: 456 | ||
name: bar | ||
- ip: 209 | ||
name: stuff | ||
- ip: 199 | ||
name: things | ||
- ip: 95 | ||
name: baz | ||
|
||
assert->: assert "{{vms[0].ip}}" 456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.