diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2018-03-26 12:32:12 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2018-04-16 15:11:53 (GMT) |
commit | dca2347980862d803c182bb5898b5bfaca54aa62 (patch) | |
tree | 2cc95f9ed2d017bc1eddb7446b60b2be3e8f04dc /Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake | |
parent | cdae12f8f86730e075598118ebe5fd2f11746af7 (diff) | |
download | CMake-dca2347980862d803c182bb5898b5bfaca54aa62.zip CMake-dca2347980862d803c182bb5898b5bfaca54aa62.tar.gz CMake-dca2347980862d803c182bb5898b5bfaca54aa62.tar.bz2 |
list: Add TRANSFORM sub-command
Issue: #17823
Diffstat (limited to 'Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake')
-rw-r--r-- | Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake b/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake new file mode 100644 index 0000000..a2d7348 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake @@ -0,0 +1,48 @@ +set(mylist ALPHA BRAVO CHARLIE DELTA) + +list(TRANSFORM mylist TOLOWER OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"alpha;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER REGEX "(R|T)A" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER REGEX "(R|T)A") +if (NOT mylist STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${mylist}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() |