# HG changeset patch # User FUJIWARA Katsunori # Date 1430493303 -32400 # Node ID 8cc6036bca532e06681c5a8fa37efaa812de67b5 # Parent be4915009b09c54d322d849bec9b994695a4077f tests: make tests with temporary environment setting portable With "dash" (as "/bin/sh" on Debian GNU/Linux), command execution in "ENV=val foo bar" style doesn't work as expect in test script files, if "foo" is user-defined function: it works fine, if "foo" is existing commands like "hg". 09049042ab99 introduced tests for HGPLAIN and HGPLAINEXCEPT into test-revset.t, and all of them are in such style. This patch doesn't: - add explicit unsetting for HGPLAIN and HGPLAINEXCEPT they are already introduced by 09049042ab99 - write assignment and exporting in one line "ENV=val; export ENV" for two or more environment variables in one line causes failure of test-check-code-hg.t: it is recognized as "don't export and assign at once" unfortunately. diff -r be4915009b09 -r 8cc6036bca53 tests/test-revset.t --- a/tests/test-revset.t Thu Apr 30 23:02:52 2015 -0400 +++ b/tests/test-revset.t Sat May 02 00:15:03 2015 +0900 @@ -1066,12 +1066,16 @@ > 6 - $ HGPLAIN=1 try m + $ HGPLAIN=1 + $ export HGPLAIN + $ try m ('symbol', 'm') abort: unknown revision 'm'! [255] - $ HGPLAIN=1 HGPLAINEXCEPT=revsetalias try m + $ HGPLAINEXCEPT=revsetalias + $ export HGPLAINEXCEPT + $ try m ('symbol', 'm') (func ('symbol', 'merge') @@ -1081,8 +1085,6 @@ > 6 -(for some reason HGPLAIN and HGPLAINEXCEPT can carry forward) - $ unset HGPLAIN $ unset HGPLAINEXCEPT @@ -1097,14 +1099,18 @@ 8 - $ HGPLAIN=1 try 'p2(.)' + $ HGPLAIN=1 + $ export HGPLAIN + $ try 'p2(.)' (func ('symbol', 'p2') ('symbol', '.')) * set: - $ HGPLAIN=1 HGPLAINEXCEPT=revsetalias try 'p2(.)' + $ HGPLAINEXCEPT=revsetalias + $ export HGPLAINEXCEPT + $ try 'p2(.)' (func ('symbol', 'p2') ('symbol', '.'))