view src/testdir/bench_re_freeze.vim @ 19653:5ec5427fcedf v8.2.0383

patch 8.2.0383: wrong feature check causes test not to be run Commit: https://github.com/vim/vim/commit/4f32f9c90e5710627467d74b415b3dc46fcc593a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 15 14:53:35 2020 +0100 patch 8.2.0383: wrong feature check causes test not to be run Problem: Wrong feature check causes test not to be run. Solution: Use CheckFunction instead of CheckFeature. (Ozaki Kiichi, closes #5781)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Mar 2020 15:00:04 +0100
parents adfbffe1e642
children
line wrap: on
line source

"Test for benchmarking the RE engine

so small.vim
if !has("reltime") | finish | endif
func! Measure(file, pattern, arg)
	for re in range(3)
	    let sstart=reltime()
	    let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'".
		\ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg)
	    call system(cmd. ' '. a:file)
	    $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart)))
	endfor
endfunc