From: Yegappan Lakshmanan Date: Tue, 4 Apr 2023 03:11:29 +0000 (-0700) Subject: Add tests for LspGotoTypeDef and LspGotoImpl X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4f03c70b6b4b3adaa736b10de97ec20f0d81bdbd;p=vim-lsp.git Add tests for LspGotoTypeDef and LspGotoImpl --- diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 03ec567..7e9909c 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -838,26 +838,35 @@ def g:Test_LspGotoSymbol() exe "normal! \" assert_equal([21, 6], [line('.'), col('.')]) - # FIXME: :LspGotoTypeDef and :LspGotoImpl are supported only with clang-14. - # This clangd version is not available in Github CI. + # :LspGotoTypeDef + cursor(21, 2) + :LspGotoTypeDef + assert_equal([1, 7], [line('.'), col('.')]) + exe "normal! \" + assert_equal([21, 2], [line('.'), col('.')]) + + # :LspGotoImpl + cursor(21, 6) + :LspGotoImpl + assert_equal([12, 11], [line('.'), col('.')]) + exe "normal! \" + assert_equal([21, 6], [line('.'), col('.')]) # Error cases - # FIXME: The following tests are failing in Github CI. Comment out for now. - if 0 :messages clear cursor(11, 5) :LspGotoDeclaration var m = execute('messages')->split("\n") - assert_equal('Error: declaration is not found', m[1]) + assert_equal('Error: symbol declaration is not found', m[1]) :messages clear :LspGotoDefinition m = execute('messages')->split("\n") - assert_equal('Error: definition is not found', m[1]) + assert_equal('Error: symbol definition is not found', m[1]) :messages clear :LspGotoImpl m = execute('messages')->split("\n") - assert_equal('Error: implementation is not found', m[1]) - endif + assert_equal('Error: symbol implementation is not found', m[1]) + :messages clear # Test for LspPeekDeclaration cursor(21, 6)