test/clangd_tests.vim | 46 +++++++++++++++++++++++----------------------- diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 28c2ea8491ff37e94734ea09e8faeeff90dd3923..27a0b8bd967ffb519ad5a1ac6ceecafbdf45faf6 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -113,7 +113,7 @@ assert_equal('', execute('LspFormat')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspFormat')->split("\n")) :%bw! @@ -231,7 +231,7 @@ assert_equal('', execute('LspShowReferences')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspShowReferences')->split("\n")) :%bw! @@ -267,11 +267,11 @@ close g:LspOptionsSet({showDiagInPopup: false}) normal gg var output = execute('LspDiagCurrent')->split("\n") - assert_equal('No diagnostic messages found for current line', output[0]) + assert_match('No diagnostic messages found for current line', output[0]) :LspDiagFirst assert_equal([3, 14], [line('.'), col('.')]) output = execute('LspDiagCurrent')->split("\n") - assert_equal("Expected ';' at end of declaration (fix available)", output[0]) + assert_match("Expected ';' at end of declaration (fix available)", output[0]) :normal! 0 :LspDiagHere assert_equal([3, 14], [line('.'), col('.')]) @@ -280,12 +280,12 @@ assert_equal([5, 2], [line('.'), col('.')]) :LspDiagNext assert_equal([7, 2], [line('.'), col('.')]) output = execute('LspDiagNext')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) :LspDiagPrev :LspDiagPrev :LspDiagPrev output = execute('LspDiagPrev')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) # :[count]LspDiagNext cursor(3, 1) @@ -294,14 +294,14 @@ assert_equal([5, 2], [line('.'), col('.')]) :2LspDiagNext assert_equal([7, 2], [line('.'), col('.')]) output = execute(':2LspDiagNext')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) # :[count]LspDiagPrev cursor(7, 2) :4LspDiagPrev assert_equal([3, 14], [line('.'), col('.')]) output = execute(':4LspDiagPrev')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) :%d setline(1, ['void blueFunc()', '{', '}']) @@ -391,7 +391,7 @@ assert_equal('', execute('LspDiagPrev')) assert_equal([1, 5], [line('.'), col('.')]) var output = execute('LspDiagPrev')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) cursor(2, 1) assert_equal('', execute('LspDiagFirst')) @@ -422,7 +422,7 @@ # Line without diagnostics cursor(3, 1) output = execute('LspDiagHere')->split("\n") - assert_equal('Error: No more diagnostics found on this line', output[0]) + assert_match('No more diagnostics found on this line', output[0]) g:LspOptionsSet({showDiagInPopup: false}) for i in range(1, 5) @@ -476,7 +476,7 @@ assert_equal([1, 9], [line('.'), col('.')]) :2LspDiagNext assert_equal([2, 9], [line('.'), col('.')]) output = execute(':2LspDiagNext')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) cursor(1, 1) :99LspDiagNext @@ -494,7 +494,7 @@ assert_equal([1, 9], [line('.'), col('.')]) :2LspDiagPrev assert_equal([1, 5], [line('.'), col('.')]) output = execute(':2LspDiagPrev')->split("\n") - assert_equal('Error: No more diagnostics found', output[0]) + assert_match('No more diagnostics found', output[0]) cursor(3, 3) :99LspDiagPrev @@ -614,7 +614,7 @@ assert_equal('', execute('LspCodeAction')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspCodeAction')->split("\n")) :%bw! @@ -684,7 +684,7 @@ assert_equal('', execute('LspRename')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspRename')->split("\n")) :%bw! @@ -784,7 +784,7 @@ assert_equal('', execute('LspSelectionExpand')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspSelectionExpand')->split("\n")) :%bw! @@ -871,15 +871,15 @@ :messages clear cursor(11, 5) :LspGotoDeclaration var m = execute('messages')->split("\n") - assert_equal('Error: symbol declaration is not found', m[1]) + assert_match('symbol declaration is not found', m[1]) :messages clear :LspGotoDefinition m = execute('messages')->split("\n") - assert_equal('Error: symbol definition is not found', m[1]) + assert_match('symbol definition is not found', m[1]) :messages clear :LspGotoImpl m = execute('messages')->split("\n") - assert_equal('Error: symbol implementation is not found', m[1]) + assert_match('symbol implementation is not found', m[1]) :messages clear endif @@ -917,11 +917,11 @@ assert_equal('', execute('LspGotoImpl')) # file without an LSP server edit a.raku - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspGotoDefinition')->split("\n")) - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspGotoDeclaration')->split("\n")) - assert_equal(['Error: Language server for "raku" file type is not found'], + assert_match(['Language server for "raku" file type is not found'], execute('LspGotoImpl')->split("\n")) :%bw! @@ -998,7 +998,7 @@ assert_equal(['function f1', '', '→ int', 'Parameters:', '- int a', '', 'int f1(int a)'], getbufline(winbufnr(p[0]), 1, '$')) popup_close(p[0]) cursor(7, 1) output = execute(':LspHover')->split("\n") - assert_equal('No hover messages found for current position', output[0]) + assert_match('No hover messages found for current position', output[0]) output = execute(':silent LspHover')->split("\n") assert_equal([], output) assert_equal([], popup_list()) @@ -1093,7 +1093,7 @@ feedkeys(":LspSymbolSearch lsptest_funcA\\B\", "xt") assert_equal([5, 6], [line('.'), col('.')]) var output = execute(':LspSymbolSearch lsptest_nonexist')->split("\n") - assert_equal(['Error: Symbol "lsptest_nonexist" is not found'], output) + assert_match(['Symbol "lsptest_nonexist" is not found'], output) :%bw! enddef