First Commit
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled

This commit is contained in:
dsutanto committed 2025-11-19 16:23:45 +07:00
commit dbdc5bcc4a
1791 files changed
+489451

No files matched your search

@@ -0,0 +1,33 @@
#include <pqxx/separated_list>
#include "../test_helpers.hxx"
// Test program for separated_list.
namespace
{
void test_separated_list()
{
PQXX_CHECK_EQUAL(
pqxx::separated_list(",", std::vector<int>{}), "",
"Empty list came out wrong.");
PQXX_CHECK_EQUAL(
pqxx::separated_list(",", std::vector<int>{5}), "5",
"Single-element list came out wrong.");
PQXX_CHECK_EQUAL(
pqxx::separated_list(",", std::vector<int>{3, 6}), "3,6",
"Things go wrong once separators come in.");
std::vector<int> const nums{1, 2, 3};
PQXX_CHECK_EQUAL(
pqxx::separated_list(
"+", std::begin(nums), std::end(nums),
[](auto elt) { return *elt * 2; }),
"2+4+6", "Accessors don't seem to work.");
}
PQXX_REGISTER_TEST(test_separated_list);
} // namespace