diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-10 10:32:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-10 10:32:15 +0200 |
commit | 28e9fd496fd39d180a2d786378c4ff396b9f69c8 (patch) | |
tree | 39c3b9c30b3255054e7a4a80b57990cb1375a3af /tests/dependency | |
parent | 1ea33ab70f88fcfebf388a9a438e3c1e56fbdf0f (diff) |
Add ad hoc recipe if-else, switch tests (and fix bug)
Diffstat (limited to 'tests/dependency')
-rw-r--r-- | tests/dependency/recipe/testscript | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/tests/dependency/recipe/testscript b/tests/dependency/recipe/testscript index ee598b7..5f9bdf1 100644 --- a/tests/dependency/recipe/testscript +++ b/tests/dependency/recipe/testscript @@ -390,6 +390,155 @@ EOI <stdin>:5:3: error: duplicate recipe for perform(update) EOE +: if-else +: +$* <<EOI 2>>/~%EOE% +f = false +alias{x}: alias{z} +% +if $f +{{ + false +}} +else +{{ + echo +}} +dump alias{x} +EOI +<stdin>:12:1: dump: +% .+/alias\{x\}: .+/:alias\{z\}% + % [diag=echo] perform(update) + {{ + echo + }} +EOE + +: if-else-replay +: +$* <<EOI 2>>/~%EOE% +f = false +alias{x y}: alias{z} +% +if $f +{{ + false +}} +else +{{ + echo +}} +dump alias{y} +EOI +<stdin>:12:1: dump: +% .+/alias\{y\}: .+/:alias\{z\}% + % [diag=echo] perform(update) + {{ + echo + }} +EOE + +: if-no-else +: +$* <<EOI 2>>/~%EOE% +f = false +alias{x}: alias{z} +% +if $f +{{ + false +}} +dump alias{x} +EOI +<stdin>:8:1: dump: +% .+/alias\{x\}: .+/:alias\{z\}% +EOE + +: switch +: +$* <<EOI 2>>/~%EOE% +f = 2 +alias{x}: alias{z} +% +switch $f +{ + case 1 + {{ + false + }} + case 2 + {{ + echo + }} + default + {{ + false + }} +} +dump alias{x} +EOI +<stdin>:19:1: dump: +% .+/alias\{x\}: .+/:alias\{z\}% + % [diag=echo] perform(update) + {{ + echo + }} +EOE + +: switch-replay +: +$* <<EOI 2>>/~%EOE% +f = 2 +alias{x y}: alias{z} +% +switch $f +{ + case 1 + {{ + false + }} + case 2 + {{ + echo + }} + default + {{ + false + }} +} +dump alias{y} +EOI +<stdin>:19:1: dump: +% .+/alias\{y\}: .+/:alias\{z\}% + % [diag=echo] perform(update) + {{ + echo + }} +EOE + +: switch-no-default +: +$* <<EOI 2>>/~%EOE% +f = 2 +alias{x}: alias{z} +% +switch $f +{ + case 0 + {{ + false + }} + case 1 + {{ + echo + }} +} +dump alias{x} +EOI +<stdin>:15:1: dump: +% .+/alias\{x\}: .+/:alias\{z\}% +EOE + : diag : { |