# Copyright (C) 2011-2012 Google Inc. # 2016 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 future.utils import PY2 from mock import MagicMock, patch from hamcrest import assert_that, equal_to import contextlib import functools import nose import os import re import sys from ycmd.utils import GetCurrentDirectory, 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