# 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 collections import defaultdict, namedtuple from unittest.mock import DEFAULT, MagicMock, patch from unittest import skip from hamcrest import ( assert_that, contains_exactly, contains_inanyorder, equal_to ) import contextlib import functools import json import os import re import sys from unittest import skipIf from ycmd.utils import GetCurrentDirectory, OnMac, OnWindows, 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