1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2026-10-23 21:49:05 +03:00

chore(external-libs): remove unused pattern matching lib b/c the standard will presumably use a different implementation for pattern matching.

This commit is contained in:
Leonid Fedorov
2023-09-12 12:04:34 +03:00
committed by GitHub
parent 11b3aed91b
commit 70111eba3d
4 changed files with 0 additions and 180 deletions

View File

@@ -131,7 +131,6 @@ INCLUDE(columnstore_version)
INCLUDE(misc)
INCLUDE(boost)
INCLUDE(thrift)
INCLUDE(mpark_patterns)
FIND_PACKAGE(BISON)
IF (NOT BISON_FOUND)

View File

@@ -1,19 +0,0 @@
include(ExternalProject)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(_toolset "gcc")
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(_toolset "clang")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(_toolset "intel-linux")
endif()
ExternalProject_Add(mpark_patterns
PREFIX external/patterns
URL https://github.com/mpark/patterns/archive/refs/tags/v0.3.0.tar.gz
URL_HASH SHA256=80e6af808a4d74d5d7358666303eb1dbfc5582313ff9fa31d1c0d3280d3bd9e7
BUILD_IN_SOURCE TRUE
LOG_BUILD TRUE
LOG_INSTALL TRUE
EXCLUDE_FROM_ALL TRUE
)

View File

@@ -80,12 +80,6 @@ if (WITH_UNITTESTS)
target_link_libraries(comparators_tests ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
add_test(NAME columnstore:comparators_tests COMMAND comparators_tests)
add_executable(patterns_test patterns_test.cpp)
add_dependencies(patterns_test googletest mpark_patterns)
target_include_directories(patterns_test PUBLIC ${ENGINE_COMMON_INCLUDES} ${ENGINE_BLOCKCACHE_INCLUDE} ${ENGINE_PRIMPROC_INCLUDE} )
target_link_libraries(patterns_test ${GTEST_LIBRARIES})
gtest_add_tests(TARGET patterns_test TEST_PREFIX mpark_patterns:)
# standalone EM routines test
add_executable(brm_em_standalone brm-em-standalone.cpp)
target_link_libraries(brm_em_standalone ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)

View File

@@ -1,154 +0,0 @@
#include <mpark/patterns.hpp>
#include <string>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
struct Aggregate
{
double d;
std::string s;
std::vector<int> v;
};
TEST(Aggregate, LRef)
{
Aggregate aggregate{4.2, "hello", {101, 202}};
using namespace mpark::patterns;
double& result = match(aggregate)(
pattern(ds(arg, "world", _)) = [](double& d) -> double& { return d; },
pattern(ds(arg, "hello", _)) = [](double& d) -> double& { return d; });
EXPECT_EQ(aggregate.d, result);
EXPECT_EQ(&aggregate.d, &result);
}
TEST(Aggregate, ConstLRef)
{
const Aggregate aggregate{4.2, "hello", {101, 202}};
using namespace mpark::patterns;
const double& result = match(aggregate)(
pattern(ds(arg, "world", _)) = [](const double& d) -> const double& { return d; },
pattern(ds(arg, "hello", _)) = [](const double& d) -> const double& { return d; });
EXPECT_EQ(aggregate.d, result);
EXPECT_EQ(&aggregate.d, &result);
}
TEST(Aggregate, RRef)
{
auto aggregate = [] { return Aggregate{4.2, "hello", {101, 202}}; };
using namespace mpark::patterns;
double result = match(aggregate())(
pattern(ds(arg, "world", _)) = [](double&& d) -> double { return std::move(d); },
pattern(ds(arg, "hello", _)) = [](double&& d) -> double { return std::move(d); });
EXPECT_EQ(4.2, result);
}
TEST(Aggregate, Empty)
{
struct
{
} empty;
using namespace mpark::patterns;
match(empty)(pattern(ds()) = [] {});
}
TEST(Aggregate, OneChar)
{
struct
{
char x;
} one{'x'};
using namespace mpark::patterns;
int result = match(one)(
pattern(ds('a')) = [] { return false; }, pattern(ds('x')) = [] { return true; });
EXPECT_TRUE(result);
}
TEST(Aggregate, OneInt)
{
struct
{
int x;
} one{101};
using namespace mpark::patterns;
int result = match(one)(
pattern(ds(101)) = [] { return true; }, pattern(ds(1)) = [] { return false; });
EXPECT_TRUE(result);
}
TEST(Aggregate, TwoChars)
{
struct
{
char x;
char y;
} two{'x', 'y'};
using namespace mpark::patterns;
bool result = match(two)(
pattern(ds('a', 'b')) = [] { return false; }, pattern(ds('x', 'y')) = [] { return true; });
EXPECT_TRUE(result);
}
TEST(Aggregate, TwoInts)
{
struct
{
int x;
int y;
} two{101, 202};
using namespace mpark::patterns;
bool result = match(two)(
pattern(ds(1, 2)) = [] { return false; }, pattern(ds(101, 202)) = [] { return true; });
EXPECT_TRUE(result);
}
TEST(Aggregate, ThreeChars)
{
struct
{
char x;
char y;
char z;
} three{'x', 'y', 'z'};
using namespace mpark::patterns;
bool result = match(three)(
pattern(ds('x', 'y', 'z')) = [] { return true; }, pattern(ds('a', 'b', 'c')) = [] { return false; });
EXPECT_TRUE(result);
}
TEST(Aggregate, FourChars)
{
struct
{
char a;
char b;
char c;
char d;
} four{'a', 'b', 'c', 'd'};
using namespace mpark::patterns;
bool result = match(four)(
pattern(ds('p', 'q', 'r', 's')) = [] { return false; },
pattern(ds('a', 'b', 'c', 'd')) = [] { return true; });
EXPECT_TRUE(result);
}