diff options
author | Jean Delvare <jdelvare@suse.de> | 2013-12-20 22:36:29 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2013-12-20 22:36:29 +0100 |
commit | c0b75c03892e72d491dcbe448ff95c3ead43ff8b (patch) | |
tree | dc5fcf1fcc9e4cde647def5503224a68eae839e0 /test/tester.test | |
parent | 0b191eec5dd6cdb8b74d92a34bd5f0d0261b0009 (diff) | |
download | quilt-c0b75c03892e72d491dcbe448ff95c3ead43ff8b.tar.gz |
test/run: Fix variable substitution
Variable substitution on command lines was happening too early so
setting a variable only took effect with the second next line of the
test case.
Additionally, there was no check that the environment variable was
actually set. This resulted in perl warnings during the test suite if
a variable is ever used before having been set.
Fix both issues.
Also add a test case for this feature, to avoid a future breakage.
Some of the tester script features are tricky and easy to get wrong,
so test them independently of quilt in a dedicated test case.
Diffstat (limited to 'test/tester.test')
-rw-r--r-- | test/tester.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/tester.test b/test/tester.test new file mode 100644 index 0000000..bc32e32 --- /dev/null +++ b/test/tester.test @@ -0,0 +1,25 @@ +# Test the testing code itself + +# Exported variables should be available immediately after being set +$ echo %{VAR} +> +$ export VAR=foo +$ echo %{VAR} +> foo +$ export VAR=bar +$ echo %{VAR} +> bar + +# Exported variables should survive accross commands and comments +$ true +$ echo %{VAR} +> bar + +# Test multiple use cases +$ echo "A %{VAR}%{VAR}ian walks into a %{VAR}" +> A barbarian walks into a bar + +# Test combined use and set +$ export PLACE=%{VAR}racks +$ echo %{PLACE} +> barracks |