Skip to content
This repository
Browse code

Merge branch 'fix-failures-on-travis-ci'

Close gh-34.
  • Loading branch information...
commit 2ff5ddde341a432643bf8013ceaa5fb9a78a80a7 2 parents 5d3c8ce + 39bb7df
Kana Natsuno authored

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. +11 3 t/snr-prefix.vim
14 t/snr-prefix.vim
@@ -2,22 +2,30 @@ call vspec#hint({'sid': 'textobj#user#_sid()'})
2 2
3 3 let g:__FILE__ = expand('<sfile>')
4 4
  5 +let s:to_be_snr_prefix = {}
  6 +function! s:to_be_snr_prefix.match(actual)
  7 + " NB: `Expect a:actual =~# "^\<SNR>\\d\\+_$"` fails depending on 'encoding'.
  8 + return a:actual =~# '\d\+_$' &&
  9 + \ substitute(a:actual, '\d\+_$', '', '') ==# "\<SNR>"
  10 +endfunction
  11 +call vspec#customize_matcher('to_be_snr_prefix', s:to_be_snr_prefix)
  12 +
5 13 describe 's:snr_prefix'
6 14 context 'in a ordinary situation (verbose=0)'
7 15 it 'works'
8   - 0 verbose Expect Call('s:snr_prefix', g:__FILE__) =~# "^\<SNR>\\d\\+_$"
  16 + 0 verbose Expect Call('s:snr_prefix', g:__FILE__) to_be_snr_prefix
9 17 end
10 18 end
11 19
12 20 context 'in a weird situation (verbose=14)'
13 21 it 'works'
14   - 14 verbose Expect Call('s:snr_prefix', g:__FILE__) =~# "^\<SNR>\\d\\+_$"
  22 + 14 verbose Expect Call('s:snr_prefix', g:__FILE__) to_be_snr_prefix
15 23 end
16 24 end
17 25
18 26 context 'in a weird situation (verbose=15)'
19 27 it 'works'
20   - 15 verbose Expect Call('s:snr_prefix', g:__FILE__) =~# "^\<SNR>\\d\\+_$"
  28 + 15 verbose Expect Call('s:snr_prefix', g:__FILE__) to_be_snr_prefix
21 29 end
22 30 end
23 31 end

0 comments on commit 2ff5ddd

Please sign in to comment.
Something went wrong with that request. Please try again.