Last active
August 29, 2015 14:13
-
-
Save itchyny/8e5f88f9e5c4700ff1d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profile start profile.log | |
profile func *strwidth* | |
set rtp+=/path/to/vital.vim/ | |
let s:V = vital#of('vital') | |
let s:P = s:V.import('Prelude') | |
function! Error_strwidthpart() | |
endfunction | |
function! Test_strwidthpart() | |
let strmin = 0 | |
let strmax = 300 | |
let strstep = 5 | |
let outmin = -10 | |
let outmax = 300 | |
let outstep = 5 | |
for i in range(strmin, strmax, strstep) | |
let str = repeat('あa', i) | |
for j in range(outmin, outmax, outstep) | |
let out1 = s:P.strwidthpart(str, i) | |
let out2 = s:P.new_strwidthpart(str, i) | |
if out1 !=# out2 | |
call Error_strwidthpart() | |
endif | |
let out1 = s:P.strwidthpart_reverse(str, i) | |
let out2 = s:P.new_strwidthpart_reverse(str, i) | |
if out1 !=# out2 | |
call Error_strwidthpart() | |
endif | |
endfor | |
endfor | |
endfunction | |
call Test_strwidthpart() | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
profile result: https://gist.github.com/itchyny/21937d6847eb87f6104a