# Copyright (C) 2011-2019 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # YouCompleteMe is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with YouCompleteMe. If not, see . from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from collections import defaultdict, namedtuple from future.utils import iteritems, PY2 from mock import DEFAULT, MagicMock, patch from hamcrest import assert_that, equal_to import contextlib import functools import json import nose import os import re import sys try: from unittest import skipIf except ImportError: from unittest2 import skipIf from ycmd.utils import GetCurrentDirectory, OnMac, OnWindows, ToBytes, ToUnicode BUFNR_REGEX = re.compile( '^bufnr\\(\'(?P.+)\', ([01])\\)$' ) BUFWINNR_REGEX = re.compile( '^bufwinnr\\((?P[0-9]+)\\)$' ) BWIPEOUT_REGEX = re.compile( '^(?:silent! )bwipeout!? (?P[0-9]+)$' ) GETBUFVAR_REGEX = re.compile( '^getbufvar\\((?P[0-9]+), "(?P