code, docs, tests: Add support for dot-separation
This commit is contained in:
@@ -15,7 +15,9 @@ test_generate("0.0.3" PATCH 3)
|
||||
test_generate("0.0.0.4" TWEAK 4)
|
||||
test_generate("0.0-5" COMPRESS PRERELEASE 5)
|
||||
test_generate("0.0a5" COMPRESS PRERELEASE a5)
|
||||
test_generate("0.0a5.5" COMPRESS PRERELEASE "a5;5")
|
||||
test_generate("0.0+6" BUILD 6)
|
||||
test_generate("0.0+6.8" BUILD "6;8")
|
||||
# - Invalid Cases
|
||||
test_generate("-1.0.0" FAIL MAJOR "-1")
|
||||
test_generate("0.-1.0" FAIL MINOR "-1")
|
||||
@@ -47,6 +49,9 @@ test_parse("1.2.3.4-5+6" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE 5 BUILD 6)
|
||||
test_parse("1.2a5+6" MAJOR 1 MINOR 2 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2.3a5+6" MAJOR 1 MINOR 2 PATCH 3 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2.3.4a5+6" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2a5.b5+6.66" MAJOR 1 MINOR 2 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
test_parse("1.2.3a5.b5+6.66" MAJOR 1 MINOR 2 PATCH 3 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
test_parse("1.2.3.4a5.b5+6.66" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
# - Invalid Cases
|
||||
test_parse("" FAIL)
|
||||
test_parse("cmake" FAIL)
|
||||
|
||||
+6
-6
@@ -66,7 +66,7 @@ function(test_parse)
|
||||
set(MESSAGE "MAJOR component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_MAJOR STREQUAL _ARGS_MAJOR))
|
||||
set(MESSAGE "MAJOR component mismatch.")
|
||||
set(MESSAGE "MAJOR component mismatch: '${_TEST_MAJOR}' != '${_ARGS_MAJOR}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -76,7 +76,7 @@ function(test_parse)
|
||||
set(MESSAGE "MINOR component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_MINOR STREQUAL _ARGS_MINOR))
|
||||
set(MESSAGE "MINOR component mismatch.")
|
||||
set(MESSAGE "MINOR component mismatch: '${_TEST_MINOR}' != '${_ARGS_MINOR}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -86,7 +86,7 @@ function(test_parse)
|
||||
set(MESSAGE "PATCH component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_PATCH STREQUAL _ARGS_PATCH))
|
||||
set(MESSAGE "PATCH component mismatch.")
|
||||
set(MESSAGE "PATCH component mismatch: '${_TEST_PATCH}' != '${_ARGS_PATCH}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -96,7 +96,7 @@ function(test_parse)
|
||||
set(MESSAGE "TWEAK component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_TWEAK STREQUAL _ARGS_TWEAK))
|
||||
set(MESSAGE "TWEAK component mismatch.")
|
||||
set(MESSAGE "TWEAK component mismatch: '${_TEST_TWEAK}' != '${_ARGS_TWEAK}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -106,7 +106,7 @@ function(test_parse)
|
||||
set(MESSAGE "PRERELEASE component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_PRERELEASE STREQUAL _ARGS_PRERELEASE))
|
||||
set(MESSAGE "PRERELEASE component mismatch.")
|
||||
set(MESSAGE "PRERELEASE component mismatch: '${_TEST_PRERELEASE}' != '${_ARGS_PRERELEASE}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -116,7 +116,7 @@ function(test_parse)
|
||||
set(MESSAGE "BUILD component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_BUILD STREQUAL _ARGS_BUILD))
|
||||
set(MESSAGE "BUILD component mismatch.")
|
||||
set(MESSAGE "BUILD component mismatch: '${_TEST_BUILD}' != '${_ARGS_BUILD}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user