From a86295cd5c2bf15a11eb05e226fd8e226154f6a6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 12:26:17 +0800 Subject: vim-patch:8.2.0615: regexp benchmark stest is old style (#20940) Problem: Regexp benchmark stest is old style. Solution: Make it a new style test. Fix using a NULL list. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5963) https://github.com/vim/vim/commit/ad48e6c1590842ab6d48e6caba3e9250734dae27 N/A patches: vim-patch:9.0.0829: wrong counts in macro comment --- test/benchmark/bench_regexp_spec.lua | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 test/benchmark/bench_regexp_spec.lua (limited to 'test/benchmark/bench_regexp_spec.lua') diff --git a/test/benchmark/bench_regexp_spec.lua b/test/benchmark/bench_regexp_spec.lua new file mode 100644 index 0000000000..903af5f574 --- /dev/null +++ b/test/benchmark/bench_regexp_spec.lua @@ -0,0 +1,64 @@ +-- Test for benchmarking the RE engine. + +local helpers = require('test.functional.helpers')(after_each) +local insert, source = helpers.insert, helpers.source +local clear, command = helpers.clear, helpers.command + +-- Temporary file for gathering benchmarking results for each regexp engine. +local result_file = 'benchmark.out' +-- Fixture containing an HTML fragment that can make a search appear to freeze. +local sample_file = 'src/nvim/testdir/samples/re.freeze.txt' + +-- Vim script code that does both the work and the benchmarking of that work. +local measure_cmd = + [[call Measure(%d, ']] .. sample_file .. [[', '\s\+\%%#\@