Skip to content

Commit

Permalink
Fixing tests for go v1.22.0
Browse files Browse the repository at this point in the history
Latest go version changes how detailed info looks, so we need to change the
tests. Opted for matching with a regex, so the test can work with older
versions of go as well.
  • Loading branch information
bstaletic committed Feb 14, 2024
1 parent 7bc5d08 commit 492a771
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ycmd/tests/go/get_completions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with ycmd. If not, see <http://www.gnu.org/licenses/>.

from hamcrest import ( all_of,
assert_that,
from hamcrest import ( assert_that,
has_items,
has_key,
is_not )
is_not,
matches_regexp )
from unittest import TestCase

from ycmd.tests.go import setUpModule, tearDownModule # noqa
Expand All @@ -45,16 +45,15 @@ def test_GetCompletions_Basic( self, app ):
results = app.post_json( '/completions',
completion_data ).json[ 'completions' ]
assert_that( results,
all_of(
has_items(
CompletionEntryMatcher(
'Llongfile',
'int',
{
'detailed_info': 'Llongfile\n\n'
'detailed_info': matches_regexp( 'Llongfile\n\n'
'These flags define which text to'
' prefix to each log entry generated'
' by the Logger.',
' by the \\[?Logger\\]?\\.' ),
'menu_text': 'Llongfile',
'kind': 'Constant',
}
Expand All @@ -70,7 +69,7 @@ def test_GetCompletions_Basic( self, app ):
'menu_text': 'Logger',
'kind': 'Struct',
}
) ) ) )
) ) )


# This completer does not require or support resolve
Expand Down

0 comments on commit 492a771

Please sign in to comment.