Skip to content

@nelstrom /case-comparison.vim
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
" http://learnvimscriptthehardway.stevelosh.com/chapters/22.html
"
describe '=='
it 'compares strings respecting user-defined &ignorecase setting'
set noignorecase
Expect 'abc' == 'abc'
Expect 'abc' not == 'ABC'
set ignorecase
Expect 'abc' == 'abc'
Expect 'abc' == 'ABC'
end
end
describe '==#'
it 'compares strings case-sensitively'
set ignorecase
Expect 'abc' ==# 'abc'
Expect 'abc' not ==# 'ABC'
set noignorecase
Expect 'abc' ==# 'abc'
Expect 'abc' not ==# 'ABC'
end
end
describe '==?'
it 'compares strings ignoring case'
set ignorecase
Expect 'abc' ==? 'abc'
Expect 'abc' ==? 'ABC'
set noignorecase
Expect 'abc' ==? 'abc'
Expect 'abc' ==? 'ABC'
end
end
@nelstrom
Owner

Check out episode 50 of Vimcasts for an introduction to vspec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.