Skip to content

Commit

Permalink
Rewritten test to not use <format>
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaim committed Mar 6, 2024
1 parent 7cf8d13 commit 3cccb6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest/doctest.h"

#include <format>
#include <string>

#include <sparrow/sparrow_version.hpp>

TEST_CASE("version is readable")
{
// TODO: once available on OSX, use `<format>` facility instead.
// We only try to make sure the version valeus are printable, whatever their type.
// AKA this is not written to be fancy but to force conversion to string.
using namespace sparrow;
[[maybe_unused]] const std::string printable_version = std::format("sparrow version : {}.{}.{}", SPARROW_VERSION_MAJOR, SPARROW_VERSION_MINOR, SPARROW_VERSION_PATCH);
[[maybe_unused]] const std::string printable_version = std::string("sparrow version : ") + std::to_string(SPARROW_VERSION_MAJOR) + "." + std::to_string(SPARROW_VERSION_MINOR) "." std::to_string(SPARROW_VERSION_PATCH);
}

0 comments on commit 3cccb6f

Please sign in to comment.