basedOpinionated utility library |
git clone git://git.dimitrijedobrota.com/based.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
static_view_test.cpp (609B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include <string>
4 #include "based/utility/static_view.hpp"
6 #include <catch2/catch_test_macros.hpp>
8 TEST_CASE("valid type", "[utility/to_string_view]")
9 {
10 static constexpr auto test = based::to_string_view(
11 []() consteval
12 {
13 std::string res;
15 const auto start = 65;
16 const auto end = 122;
17 for (int i = start; i < end; i++) {
18 if (i % 2 == 1) {
19 res += static_cast<char>('\0' + i);
20 }
21 }
23 return res;
24 }
25 );
27 STATIC_REQUIRE(test == "ACEGIKMOQSUWY[]_acegikmoqsuwy");
28 }