patch 8.0.0442: patch shell command not well escaped

Problem:    Patch shell command uses double quotes around the argument, which
            allows for $HOME to be expanded. (Etienne)
Solution:   Use single quotes on Unix. (closes #1543)
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 73f944b..c23e8a1 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -318,9 +318,20 @@
   bwipe!
   new
   call assert_fails('diffpatch Xpatch', 'E816:')
-  call setline(1, ['1', '2', '3'])
-  diffpatch Xpatch
-  call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+
+  for name in ['Xpatch', 'Xpatch$HOME']
+    call setline(1, ['1', '2', '3'])
+    if name != 'Xpatch'
+      call rename('Xpatch', name)
+    endif
+    exe 'diffpatch ' . escape(name, '$')
+    call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+    if name != 'Xpatch'
+      call rename(name, 'Xpatch')
+    endif
+    bwipe!
+  endfor
+
   call delete('Xpatch')
   bwipe!
 endfunc