Skip to content

Commit 743b6f3

Browse files
mibu138mergify[bot]
authored andcommitted
Added tests for clangd SwitchSourceHeader feature
1 parent eae4cfe commit 743b6f3

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

ycmd/tests/clangd/subcommands_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,16 @@ def test_Subcommands_GoToInclude( self, app ):
757757
with self.subTest( test = test, cmd = cmd ):
758758
RunGoToTest_all( app, 'test-include', cmd, test )
759759

760+
@SharedYcmd
761+
def test_Subcommands_SwitchSourceHeader( self, app ):
762+
for test in [
763+
{ 'req': ( 'switch-source-header/a.cpp', 1, 1 ),
764+
'res': ( 'switch-source-header/a.h', 1, 1 ) },
765+
{ 'req': ( 'switch-source-header/a.h', 1, 1 ),
766+
'res': ( 'switch-source-header/a.cpp', 1, 1 ) },
767+
]:
768+
with self.subTest( test = test ):
769+
RunGoToTest_all( app, '', 'SwitchSourceHeader', test )
760770

761771
@SharedYcmd
762772
def test_Subcommands_GoToReferences( self, app ):
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "a.h"
2+
3+
void foo()
4+
{
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void foo();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-xc++
2+
-std=c++11

0 commit comments

Comments
 (0)