From 92f1bbda94c12099e80815a883dab8e2039ac1ab Mon Sep 17 00:00:00 2001 From: micbou Date: Sat, 8 Oct 2016 10:53:17 +0200 Subject: [PATCH] Add event notification tests Add tests for the BufferVisit and BufferUnload event notifications. --- python/ycm/test_utils.py | 109 ++++++++++-- python/ycm/tests/event_notification_test.py | 167 +++++++++++++----- python/ycm/tests/vimsupport_test.py | 177 ++++++++++---------- 3 files changed, 305 insertions(+), 148 deletions(-) diff --git a/python/ycm/test_utils.py b/python/ycm/test_utils.py index ea341684..4cee2fe4 100644 --- a/python/ycm/test_utils.py +++ b/python/ycm/test_utils.py @@ -33,9 +33,12 @@ import functools from ycmd.utils import ToUnicode -BUFNR_REGEX = re.compile( r"^bufnr\('(.+)', ([0-9]+)\)$" ) -BUFWINNR_REGEX = re.compile( r"^bufwinnr\(([0-9]+)\)$" ) -BWIPEOUT_REGEX = re.compile( r"^(?:silent! )bwipeout!? ([0-9]+)$" ) +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