Add test cases for #10

This commit is contained in:
Andy K. Massimino
2017-11-22 11:24:11 -05:00
parent 031ee01f7e
commit fbeb01ce30
2 changed files with 40 additions and 0 deletions

32
test/issues/10/legacy.vim Normal file
View File

@@ -0,0 +1,32 @@
if "(foo)"
let x = "(foo)"
endif
( )
let x = ( "( )" )
let y = "("
\ . ")"
"("
)
\ . ")"
let z = ( '( ' ) . ' )'
let a = " if endif "
*cpo-M*
M When excluded, "%" matching will take backslashes into
account. Thus in "( \( )" and "\( ( \)" the outer
parenthesis match. When included "%" ignores
backslashes, which is Vi compatible.
let b = '\( \)'
let c = "\\( \\)"
let d = "( \\( )" . "\\( " . '\( \)' . "\\)"

View File

@@ -0,0 +1,8 @@
function String()
let output = filter(list, "matchstr(v:val, '^\s*\zsfoo\ze\\(bar\\|baz\\)')")
let output = filter(list, 'matchstr(v:val, ''^\s*\zsfoo\ze\(bar\|baz\)'')')
endfunction