patch 8.2.1518: Vim9: cannot assign to local option

Problem:    Vim9: cannot assign to local option.
Solution:   Skip over "&l:" and "&g:". (closes #6749)
diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim
index 2f92cf9..7fbe4a5 100644
--- a/src/testdir/vim9.vim
+++ b/src/testdir/vim9.vim
@@ -41,6 +41,11 @@
   delete('Xdef')
 enddef
 
+def CheckDefAndScriptSuccess(lines: list<string>)
+  CheckDefSuccess(lines)
+  CheckScriptSuccess(['vim9script'] + lines)
+enddef
+
 " Check that a command fails both when used in a :def function and when used
 " in Vim9 script.
 def CheckScriptAndDefFailure(lines: list<string>, error: string, lnum = -3)