aboutsummaryrefslogtreecommitdiff
path: root/vim/.vim/bundle/vim-airline/t/builder.vim
diff options
context:
space:
mode:
authorxero <x@xero.nu>2014-07-14 13:23:05 -0400
committerxero <x@xero.nu>2014-07-14 13:23:05 -0400
commit56560fd597f94dfe6fe5fa79648398ab29d05775 (patch)
tree7e77d23be98b2df8ef847f49ee645085356305be /vim/.vim/bundle/vim-airline/t/builder.vim
parent1434c859bcf94a0bbee88e72c8a01849d0356293 (diff)
downloaddotfiles_ascii-56560fd597f94dfe6fe5fa79648398ab29d05775.tar.xz
dotfiles_ascii-56560fd597f94dfe6fe5fa79648398ab29d05775.zip
updated repo to manage dotfiles via gnu stow, the symlink farm manager. happy birthday commit! :birthday: :sparkles:
Diffstat (limited to 'vim/.vim/bundle/vim-airline/t/builder.vim')
-rw-r--r--vim/.vim/bundle/vim-airline/t/builder.vim80
1 files changed, 80 insertions, 0 deletions
diff --git a/vim/.vim/bundle/vim-airline/t/builder.vim b/vim/.vim/bundle/vim-airline/t/builder.vim
new file mode 100644
index 0000000..3d1afcd
--- /dev/null
+++ b/vim/.vim/bundle/vim-airline/t/builder.vim
@@ -0,0 +1,80 @@
+let g:airline_theme = 'dark'
+call airline#init#bootstrap()
+
+describe 'active builder'
+ before
+ let s:builder = airline#builder#new({'active': 1})
+ end
+
+ it 'should start with an empty statusline'
+ let stl = s:builder.build()
+ Expect stl == ''
+ end
+
+ it 'should transition colors from one to the next'
+ call s:builder.add_section('Normal', 'hello')
+ call s:builder.add_section('NonText', 'world')
+ let stl = s:builder.build()
+ Expect stl =~ '%#Normal#hello%#Normal_to_NonText#>%#NonText#world'
+ end
+
+ it 'should split left/right sections'
+ call s:builder.split()
+ let stl = s:builder.build()
+ Expect stl =~ '%='
+ end
+
+ it 'after split, sections use the right separator'
+ call s:builder.split()
+ call s:builder.add_section('Normal', 'hello')
+ call s:builder.add_section('NonText', 'world')
+ let stl = s:builder.build()
+ Expect stl =~ '%#Normal#hello%#Normal_to_NonText#<%#NonText#world'
+ end
+
+ it 'should not repeat the same highlight group'
+ call s:builder.add_section('Normal', 'hello')
+ call s:builder.add_section('Normal', 'hello')
+ let stl = s:builder.build()
+ Expect stl == '%#Normal#hello>hello'
+ end
+
+ it 'should replace accent groups with the specified group'
+ call s:builder.add_section('Normal', '%#__accent_foo#hello')
+ let stl = s:builder.build()
+ Expect stl == '%#Normal#%#Normal_foo#hello'
+ end
+
+ it 'should replace two accent groups with correct groups'
+ call s:builder.add_section('Normal', '%#__accent_foo#hello%#__accent_bar#world')
+ let stl = s:builder.build()
+ Expect stl =~ '%#Normal_foo#hello%#Normal_bar#world'
+ end
+
+ it 'should special restore group should go back to previous group'
+ call s:builder.add_section('Normal', '%#__restore__#')
+ let stl = s:builder.build()
+ Expect stl !~ '%#__restore__#'
+ Expect stl =~ '%#Normal#'
+ end
+end
+
+describe 'inactive builder'
+ before
+ let s:builder = airline#builder#new({'active': 0})
+ end
+
+ it 'should transition colors from one to the next'
+ call s:builder.add_section('Normal', 'hello')
+ call s:builder.add_section('NonText', 'world')
+ let stl = s:builder.build()
+ Expect stl =~ '%#Normal_inactive#hello%#Normal_to_NonText_inactive#>%#NonText_inactive#world'
+ end
+
+ it 'should not render accents'
+ call s:builder.add_section('Normal', '%#__accent_foo#hello%#foo#foo%#__accent_bar#world')
+ let stl = s:builder.build()
+ Expect stl == '%#Normal_inactive#hello%#foo_inactive#fooworld'
+ end
+end
+