From fbeb01ce301803ceb9dcc6a128f705bdcfad9052 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Wed, 22 Nov 2017 11:24:11 -0500 Subject: [PATCH] Add test cases for #10 --- test/issues/10/legacy.vim | 32 ++++++++++++++++++++++++++++++++ test/issues/10/string.vim | 8 ++++++++ 2 files changed, 40 insertions(+) create mode 100644 test/issues/10/legacy.vim create mode 100644 test/issues/10/string.vim diff --git a/test/issues/10/legacy.vim b/test/issues/10/legacy.vim new file mode 100644 index 0000000..6c371ba --- /dev/null +++ b/test/issues/10/legacy.vim @@ -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 = "( \\( )" . "\\( " . '\( \)' . "\\)" + diff --git a/test/issues/10/string.vim b/test/issues/10/string.vim new file mode 100644 index 0000000..9d21130 --- /dev/null +++ b/test/issues/10/string.vim @@ -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 +