since fedora 38 is EOL. and fedora 39 comes with fmt v10.0.0, also, we've switched to the build image based on fedora 40, which ships fmt-devel v10.2.1, there is no need to support fmt < 10. in this change, we drop the support fmt < 10. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#21847
34 lines
803 B
C++
34 lines
803 B
C++
|
|
/*
|
|
* Copyright (C) 2023-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#define BOOST_TEST_MODULE string_format
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <fmt/format.h>
|
|
#include <fmt/ranges.h>
|
|
#include <fmt/std.h>
|
|
|
|
#include "utils/to_string.hh"
|
|
|
|
// Test scylla's string formatters and printers defined in utils/to_string.hh
|
|
|
|
void verify_parenthesis(std::string_view sv) {
|
|
static std::unordered_map<char, char> paren_map = {{'{', '}'}, {'[', ']'}, {'(', ')'}, {'<', '>'}};
|
|
|
|
BOOST_REQUIRE(!sv.empty());
|
|
char open = sv.front();
|
|
char close = sv.back();
|
|
auto it = paren_map.find(open);
|
|
if (it == paren_map.end()) {
|
|
BOOST_FAIL(fmt::format("Unexpected delimiters: '{}' '{}'", open, close));
|
|
}
|
|
BOOST_REQUIRE_EQUAL(close, it->second);
|
|
}
|