summaryrefslogtreecommitdiff
path: root/test/test_c_flag_parsing.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-01-27 09:12:59 +0000
committerw0rp <devw0rp@gmail.com>2019-01-27 09:12:59 +0000
commit20b9dfdb4a12a4916259455ee068baf3118bd012 (patch)
tree36959851730d4769fd8d7ab28ef49163cfe2ba40 /test/test_c_flag_parsing.vader
parent6e9040da75cc9c9f6f496180847d51986754decd (diff)
downloadale-20b9dfdb4a12a4916259455ee068baf3118bd012.zip
Fix #2195 - Handle the command key being missing
Diffstat (limited to 'test/test_c_flag_parsing.vader')
-rw-r--r--test/test_c_flag_parsing.vader12
1 files changed, 12 insertions, 0 deletions
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'))