From ce0e948e66d437d069e61edc41c7e4e3c6f57367 Mon Sep 17 00:00:00 2001 From: Neil Kichler Date: Sat, 8 Feb 2025 20:02:54 +0100 Subject: [PATCH] add basic compile time tests --- include/cuinterval/interval.h | 1 - tests/tests.cpp | 1 + tests/tests_compile_time.h | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/tests_compile_time.h diff --git a/include/cuinterval/interval.h b/include/cuinterval/interval.h index 908172b..d52f7e4 100644 --- a/include/cuinterval/interval.h +++ b/include/cuinterval/interval.h @@ -18,7 +18,6 @@ constexpr bool operator==(interval lhs, interval rhs) { auto empty = [](interval x) { return !(x.lb <= x.ub); }; - return (empty(lhs) && empty(rhs)) || (lhs.lb == rhs.lb && lhs.ub == rhs.ub); } diff --git a/tests/tests.cpp b/tests/tests.cpp index 9010ca8..94f917d 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1,6 +1,7 @@ #include "generated/tests_generated.h" #include "tests_additional.h" #include "tests_common.h" +#include "tests_compile_time.h" #include #include diff --git a/tests/tests_compile_time.h b/tests/tests_compile_time.h new file mode 100644 index 0000000..438347d --- /dev/null +++ b/tests/tests_compile_time.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +// #include + +#include + +// using namespace boost::ut; + +static_assert(std::regular>); +static_assert(std::regular>); +static_assert(std::regular>); + +// void tests_compile_time() +// { +// "regular"_test = [] consteval { +// static_assert(std::regular>); +// static_assert(std::regular>); +// static_assert(std::regular>); +// }; +// }