Add some test for the CodeCompletionMode

(not finished, only 53% of this file has been covered)