Silence some warnings

This commit is contained in:
Georg Hagen
2025-11-05 21:24:40 +01:00
parent 5065260c4e
commit e462c8a42f
2 changed files with 42 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
/*
* Copyright (c) 2025. MadVoxel AG
* All rights reserved.
*/
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -550,6 +555,17 @@ TEST_CASE("testToString", "[Version]")
REQUIRE_FALSE(VERSION_1_0 == static_cast<const std::string&>(version_1));
REQUIRE_FALSE(VERSION_1_0 == static_cast<const std::string&>(version_1_2));
REQUIRE_FALSE("2.0" == static_cast<const std::string&>(version_v2_0));
REQUIRE("v2.0" == version_v2_0.String());
}
TEST_CASE("testTags", "[Version]")
{
const Version taged("v1.2.3-ALPHA-B99");
REQUIRE(taged.Build() == 99);
REQUIRE(taged.GetTags().size() == 2);
REQUIRE(taged.GetTags()[0] == "ALPHA");
REQUIRE(taged.GetTags()[1] == "B99");
REQUIRE(Version("1.90").GetTags().empty());
}
TEST_CASE("testUnimportantVersionParts", "[Version]")
@@ -603,3 +619,12 @@ TEST_CASE("testMoveConstructorAndAssignment", "[Version]")
REQUIRE(extended3 != extended);
REQUIRE(extended3 != mvConstructedExtended);
}
TEST_CASE("testLiterals", "[Version]")
{
REQUIRE(version_1 == 1_v);
REQUIRE(version_1 == 1.0_v);
REQUIRE(version_1_2 == 1.2_v);
REQUIRE(version_1_2 == 1.2_version);
REQUIRE(Version(1, 2, 3) == "1.2.3"_version);
}