aboutsummaryrefslogtreecommitdiff
path: root/tests/variable/override/testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-03-13 13:43:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-03-13 13:52:32 +0200
commit355534c22ab547bceae189e11ce36fa0dea4e743 (patch)
treec93af55fb30dd13da13bbcadd3729ed386f6e824 /tests/variable/override/testscript
parente5d55e3245e148d675d4be607f1bfa944c4559e7 (diff)
Cutoff append/prepend overrides that come before assignment override
For example: $ b x+=1 x=2 x+=3 Should result in '2 3', not '1 2 3'.
Diffstat (limited to 'tests/variable/override/testscript')
-rw-r--r--tests/variable/override/testscript29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/variable/override/testscript b/tests/variable/override/testscript
index 82b8e98..28225c1 100644
--- a/tests/variable/override/testscript
+++ b/tests/variable/override/testscript
@@ -56,6 +56,7 @@
}
: override-cached
+:
: Test overriding cached target type/pattern-specific prepend/append
:
{
@@ -76,3 +77,31 @@
1 a b X
EOO
}
+
+: order
+:
+{
+ : after
+ :
+ $* x=1 x+=2 x=+0 <<EOI >>EOO
+ print $x
+ EOI
+ 0 1 2
+ EOO
+
+ : before
+ :
+ $* x+=2 x=+0 x=1 <<EOI >>EOO
+ print $x
+ EOI
+ 1
+ EOO
+
+ : both
+ :
+ $* x=+0 x=1 x+=2 <<EOI >>EOO
+ print $x
+ EOI
+ 1 2
+ EOO
+}