diff options
Diffstat (limited to 'document')
-rw-r--r-- | document/src/tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | document/src/vespa/document/select/operator.cpp | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/document/src/tests/CMakeLists.txt b/document/src/tests/CMakeLists.txt index b78fd66b687..bb668287a8c 100644 --- a/document/src/tests/CMakeLists.txt +++ b/document/src/tests/CMakeLists.txt @@ -54,9 +54,7 @@ vespa_add_executable(document_testrunner_app TEST document_documentconfig ) -# TODO: Test with a larger chunk size to parallelize test suite runs vespa_add_test( NAME document_testrunner_app - COMMAND python ${PROJECT_SOURCE_DIR}/cppunit-parallelize.py --chunks 1 $<TARGET_FILE:document_testrunner_app> - DEPENDS document_testrunner_app + COMMAND document_testrunner_app ) diff --git a/document/src/vespa/document/select/operator.cpp b/document/src/vespa/document/select/operator.cpp index 1b97a375a5f..36113844d88 100644 --- a/document/src/vespa/document/select/operator.cpp +++ b/document/src/vespa/document/select/operator.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "operator.h" -#include <vespa/vespalib/util/regexp.h> +#include <regex> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/stllike/hash_map.hpp> #include <cassert> @@ -127,8 +127,12 @@ RegexOperator::match(const vespalib::string& val, vespalib::stringref expr) cons { // Should we catch this in parsing? if (expr.size() == 0) return ResultList(Result::True); - vespalib::Regexp expression(expr); - return ResultList(Result::get(expression.match(val))); + try { + std::basic_regex<char> expression(expr.data(), expr.size()); + return ResultList(Result::get(std::regex_search(val.c_str(), val.c_str() + val.size(), expression))); + } catch (std::regex_error &) { + return ResultList(Result::False); + } } const RegexOperator RegexOperator::REGEX("=~"); |