28#include <jau/test/catch2_ext.hpp>
35TEST_CASE(
"VersionNumber Test 00",
"[version][util]" ) {
36 std::cout <<
"jaulib version: " <<
jau::VERSION << std::endl;
43TEST_CASE(
"VersionNumber Test 01a",
"[version][util]" ) {
44 std::string vs00 =
"1.0.16";
45 std::string vs01 =
"OpenGL ES GLSL ES 1.0.16";
46 std::string vs02 =
"1.0.16 OpenGL ES GLSL ES";
49 std::cout <<
"vn0: " << vn0 << std::endl;
52 REQUIRE(
true == vn0.
hasSub());
56 std::cout <<
"vn.00: " << vn << std::endl;
59 REQUIRE(
true == vn.
hasSub());
65 std::cout <<
"vn.01: " << vn << std::endl;
68 REQUIRE(
true == vn.
hasSub());
73 std::cout <<
"vn.02: " << vn << std::endl;
76 REQUIRE(
true == vn.
hasSub());
81TEST_CASE(
"VersionNumber Test 01b",
"[version][util]" ) {
82 const std::string delim =
",";
84 const std::string vs00 =
"1,0,16";
85 const std::string vs01 =
"OpenGL ES GLSL ES 1,0,16";
86 const std::string vs02 =
"1,0,16 OpenGL ES GLSL ES";
88 std::cout <<
"vn0: " << vn0 << std::endl;
91 REQUIRE(
true == vn0.
hasSub());
96 std::cout <<
"vn.00: " << vn << std::endl;
99 REQUIRE(
true == vn.
hasSub());
104 std::cout <<
"vn.01: " << vn << std::endl;
107 REQUIRE(
true == vn.
hasSub());
112 std::cout <<
"vn.02: " << vn << std::endl;
115 REQUIRE(
true == vn.
hasSub());
120TEST_CASE(
"VersionNumber Test 02a",
"[version][util]" ) {
121 const std::string vs00 =
"4.20";
122 const std::string vs01 =
"COMPANY via Stupid tool 4.20";
123 const std::string vs02 =
"4.20 COMPANY via Stupid tool";
125 std::cout <<
"vn0: " << vn0 << std::endl;
128 REQUIRE(
true == vn0.
hasSub());
133 std::cout <<
"vn.00: " << vn << std::endl;
136 REQUIRE(
true == !vn.
hasSub());
141 std::cout <<
"vn.01: " << vn << std::endl;
144 REQUIRE(
true == !vn.
hasSub());
149 std::cout <<
"vn.02: " << vn << std::endl;
152 REQUIRE(
true == !vn.
hasSub());
157TEST_CASE(
"VersionNumber Test 02b",
"[version][util]" ) {
158 const std::string delim =
",";
160 const std::string vs00 =
"4,20";
161 const std::string vs01 =
"COMPANY via Stupid tool 4,20";
162 const std::string vs02 =
"4,20 COMPANY via Stupid tool";
166 REQUIRE(
true == vn0.
hasSub());
174 REQUIRE(
true == !vn.
hasSub());
181 REQUIRE(
true == !vn.
hasSub());
188 REQUIRE(
true == !vn.
hasSub());
193TEST_CASE(
"VersionNumber Test 03a",
"[version][util]" ) {
194 const std::string vs00 =
"A10.11.12b";
195 const std::string vs01 =
"Prelim Text 10.Funny11.Weird12 Something is odd";
196 const std::string vs02 =
"Prelim Text 10.Funny11l1.Weird12 2 Something is odd";
200 REQUIRE(
true == vn0.
hasSub());
208 REQUIRE(
true == vn.
hasSub());
215 REQUIRE(
true == vn.
hasSub());
222 REQUIRE(
true == vn.
hasSub());
227TEST_CASE(
"VersionNumber Test 03b",
"[version][util]" ) {
228 const std::string delim =
",";
230 const std::string vs00 =
"A10,11,12b";
231 const std::string vs01 =
"Prelim Text 10,Funny11,Weird12 Something is odd";
232 const std::string vs02 =
"Prelim Text 10,Funny11l1,Weird12 2 Something is odd";
236 REQUIRE(
true == vn0.
hasSub());
244 REQUIRE(
true == vn.
hasSub());
251 REQUIRE(
true == vn.
hasSub());
258 REQUIRE(
true == vn.
hasSub());
263TEST_CASE(
"VersionNumber Test 04a",
"[version][util]" ) {
264 const std::string vs00 =
"v1.2.3-10-gabcdef-dirty";
265 const std::string vs01 =
"v1.2.3-11-g1abcdef";
268 std::cout <<
"vn0: " << vn0 << std::endl;
269 std::cout <<
"vn1: " << vn1 << std::endl;
274 REQUIRE(
true == vn0.
hasSub());
278 REQUIRE(
true == vn1.
hasSub());
284 std::cout <<
"vn.00: " << vn << std::endl;
287 REQUIRE(
true == vn.
hasSub());
292 std::cout <<
"vn.01: " << vn << std::endl;
295 REQUIRE(
true == vn.
hasSub());
Simple version number class containing a version number either being defined explicit or derived from...
constexpr bool hasString() const noexcept
Returns true if constructed with a version-string, otherwise false.
Simple version number class containing a version number either being defined explicit or derived from...
constexpr bool hasMajor() const noexcept
Returns true, if the major component is defined explicitly, otherwise false.
constexpr std::size_t hash() const noexcept
constexpr bool hasMinor() const noexcept
Returns true, if the optional minor component is defined explicitly, otherwise false.
constexpr bool hasGitInfo() const noexcept
Returns true, if the optional git information is defined explicitly, otherwise false.
constexpr bool hasSub() const noexcept
Returns true, if the optional sub component is defined explicitly, otherwise false.
const jau::util::VersionNumberString VERSION
TEST_CASE("VersionNumber Test 00", "[version][util]")