diff runtime/syntax/testdir/input/sh_04.sh @ 32631:f8a2fc7d823f v9.0.1647

patch 9.0.1647: insufficient testing for syntax plugins Commit: https://github.com/vim/vim/commit/1aa5f1c21fea60fe64cdcdf6990bf43ea5cc78a0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 22 21:57:51 2023 +0100 patch 9.0.1647: insufficient testing for syntax plugins Problem: Insufficient testing for syntax plugins. Solution: Add shell file examples. (Charles Campbell) Create a messages file for easier debugging and reporting the test results.
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Jun 2023 23:00:05 +0200
parents
children ae505eaf2794
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_04.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# sh4
+Variable=${VariableB:-{VariableC}}
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}}
+
+# This gets marked as an error while its ok
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-${Var5:-eng}}}}}
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-${Var5:-$Var6}}}}}
+
+# These are OK
+Variable="${VariableB:-${VariableC:-{Var3:=eng}}}"
+Variable="${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}"
+
+# This gets marked as an error too
+: ${VariableB:-${VariableC:-{Var3:=eng}}}
+: ${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}}
+
+# This is OK
+: ${VariableB:-${VariableC:-eng}}
+: "${VariableB:-${VariableC:-eng}}"
+
+# First line is OK except its missing a closing "}",
+# so second line should have some error highlighting
+Variable=${VariableB:=${VariableC:={Var3:=${Var4:-eng}}}
+Variable=${VariableB:-${VariableC:-{Var3:=eng}}