From 20b9dfdb4a12a4916259455ee068baf3118bd012 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 27 Jan 2019 09:12:59 +0000 Subject: Fix #2195 - Handle the command key being missing --- test/test_c_flag_parsing.vader | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/test_c_flag_parsing.vader b/test/test_c_flag_parsing.vader index b09526a1..340f3ccf 100644 --- a/test/test_c_flag_parsing.vader +++ b/test/test_c_flag_parsing.vader @@ -167,6 +167,18 @@ Execute(ParseCompileCommandsFlags should parse some basic flags): \ }, \ ] }, {}) +Execute(ParseCompileCommandsFlags should tolerate items without commands): + noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c')) + + AssertEqual + \ '', + \ ale#c#ParseCompileCommandsFlags(bufnr(''), { "xmms2-mpris.c": [ + \ { + \ 'directory': '/foo/bar/xmms2-mpris', + \ 'file': '/foo/bar/xmms2-mpris/src/xmms2-mpris.c', + \ }, + \ ] }, {}) + Execute(ParseCompileCommandsFlags should fall back to files in the same directory): noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c')) -- cgit v1.2.3