# HG changeset patch # User FUJIWARA Katsunori # Date 2017-07-31 16:27:32 # Node ID 3b77d4787c1841c52afc4d98486b30d5313a0048 # Parent 798f7beadbc942e9f90fb0c30cb3696d10de4bc0 tests: avoid unexpected result at invocation of *.py file on Windows Invocation of "diff tool.py" in test-extdiff.t tests whether shellquote() is applied on specified command as expected. But direct invocation of "*.py" file might cause unexpected result on Windows according to suffix binding. For example, starting IDE, showing dialog to choose program to be used, and so on. In such case, running test-extdiff.t is easily timed out. This patch uses intermediate *.bat file on Windows, to avoid such unexpected result. Naming that intermediate file as "diff tool.bat" is enough to test applying shellquote(). diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t --- a/tests/test-extdiff.t +++ b/tests/test-extdiff.t @@ -263,8 +263,16 @@ Prepare custom diff/edit tool: will change to /tmp/extdiff.TMP and populate directories a.TMP and a and start tool +#if windows + $ cat > 'diff tool.bat' << EOF + > @$PYTHON "`pwd`/diff tool.py" + > EOF + $ hg extdiff -p "`pwd`/diff tool.bat" + [1] +#else $ hg extdiff -p "`pwd`/diff tool.py" [1] +#endif Diff in working directory, after: