summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-09-26 23:31:18 +0900
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:14 +0800
commite41d228af832f322308d607a45616b635a29f6ea (patch)
tree50044f27bcb6f7b4a3aae8a29735d17620ce72e2 /src
parentd5048281a6cc80b0cd63bcf2399230fac4a4ca08 (diff)
Regex: Disable dumping regex instructions by default in unit tests
Diffstat (limited to 'src')
-rw-r--r--src/regex_impl.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc
index ac81a84c..aa527c0c 100644
--- a/src/regex_impl.cc
+++ b/src/regex_impl.cc
@@ -583,7 +583,7 @@ private:
const ParsedRegex& m_parsed_regex;
};
-void dump(const CompiledRegex& program)
+void dump_regex(const CompiledRegex& program)
{
for (auto pos = program.bytecode.data(), end = program.bytecode.data() + program.bytecode.size();
pos < end; )
@@ -840,10 +840,10 @@ void validate_regex(StringView re)
auto test_regex = UnitTest{[]{
struct TestVM : ThreadedRegexVM<const char*>
{
- TestVM(StringView re)
+ TestVM(StringView re, bool dump = false)
: ThreadedRegexVM{m_program},
m_program{RegexCompiler::compile(re)}
- { dump(m_program); }
+ { if (dump) dump_regex(m_program); }
CompiledRegex m_program;
};