From ca29f6abe80f0e476d885f428b5e95374b0168e7 Mon Sep 17 00:00:00 2001 From: dhleong Date: Mon, 10 Oct 2016 19:22:38 -0400 Subject: [PATCH] Verify that an empty list overrides (disables) rules --- python/ycm/tests/diagnostic_filter_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/ycm/tests/diagnostic_filter_tests.py b/python/ycm/tests/diagnostic_filter_tests.py index c3126940..4038a175 100644 --- a/python/ycm/tests/diagnostic_filter_tests.py +++ b/python/ycm/tests/diagnostic_filter_tests.py @@ -75,6 +75,17 @@ class ConfigPriority_test(): _assert_accepts( f, 'This is a Burrito' ) + def ConfigPriority_FiletypeDisablesGlobal_test( self ): + # NB: if the filetype doesn't override the global, + # we would reject burrito and accept taco + opts = { 'quiet_messages' : { 'regex': 'taco'}, + 'java_quiet_messages' : { 'regex': [] } } + f = DiagnosticFilter.from_filetype( opts, [ 'java' ] ) + + _assert_accepts( f, 'This is a Taco' ) + _assert_accepts( f, 'This is a Burrito' ) + + class ListOrSingle_test(): # NB: we already test the single config above