From 41414a3a8473285fe718a37fa537499cec27f97f Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 1 Sep 2013 21:14:25 +0000 Subject: [PATCH] tests for basic color extraction. --- t/themes.vim | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 t/themes.vim diff --git a/t/themes.vim b/t/themes.vim new file mode 100644 index 00000000..d37c8fa3 --- /dev/null +++ b/t/themes.vim @@ -0,0 +1,29 @@ +describe 'themes' + after + highlight clear Foo + highlight clear Normal + end + + it 'should extract correct colors' + highlight Foo ctermfg=1 ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '1' + Expect colors[3] == '2' + end + + it 'should extract from normal if colors unavailable' + highlight Normal ctermfg=100 ctermbg=200 + highlight Foo ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '100' + Expect colors[3] == '2' + end + + it 'should flip target group if it is reversed' + highlight Foo ctermbg=222 ctermfg=103 term=reverse + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '222' + Expect colors[3] == '103' + end +end +