diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2015-07-06 20:28:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-07 13:23:21 (GMT) |
commit | 2b18cdcaba48ffeee753d97d8241dbf2a8333493 (patch) | |
tree | 6f87bea38ccac379a746d349179824f802fef30e /Tests/RunCMake/string/Append.cmake | |
parent | 7e86f567aca6b913689dc2d8c17a17936284b811 (diff) | |
download | CMake-2b18cdcaba48ffeee753d97d8241dbf2a8333493.zip CMake-2b18cdcaba48ffeee753d97d8241dbf2a8333493.tar.gz CMake-2b18cdcaba48ffeee753d97d8241dbf2a8333493.tar.bz2 |
string: add APPEND subcommand
Diffstat (limited to 'Tests/RunCMake/string/Append.cmake')
-rw-r--r-- | Tests/RunCMake/string/Append.cmake | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Append.cmake b/Tests/RunCMake/string/Append.cmake new file mode 100644 index 0000000..2634274 --- /dev/null +++ b/Tests/RunCMake/string/Append.cmake @@ -0,0 +1,58 @@ +set(out) +string(APPEND out) +if(DEFINED out) + message(FATAL_ERROR "\"string(APPEND out)\" set out to \"${out}\"") +endif() + +set(out "") +string(APPEND out) +if(NOT out STREQUAL "") + message(FATAL_ERROR "\"string(APPEND out)\" set out to \"${out}\"") +endif() + +set(out x) +string(APPEND out) +if(NOT out STREQUAL "x") + message(FATAL_ERROR "\"string(APPEND out)\" set out to \"${out}\"") +endif() + + +set(out) +string(APPEND out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(APPEND out a)\" set out to \"${out}\"") +endif() + +set(out "") +string(APPEND out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(APPEND out a)\" set out to \"${out}\"") +endif() + +set(out x) +string(APPEND out a) +if(NOT out STREQUAL "xa") + message(FATAL_ERROR "\"string(APPEND out a)\" set out to \"${out}\"") +endif() + + +set(out x) +string(APPEND out a "b") +if(NOT out STREQUAL "xab") + message(FATAL_ERROR "\"string(APPEND out a \"b\")\" set out to \"${out}\"") +endif() + +set(b) +set(out x) +string(APPEND out ${b}) +if(NOT out STREQUAL "x") + message(FATAL_ERROR "\"string(APPEND out \${b})\" set out to \"${out}\"") +endif() + +set(b b) +set(out x) +string(APPEND out a "${b}" [[ +${c}]]) +if(NOT out STREQUAL "xab\${c}") + message(FATAL_ERROR "\"string(APPEND out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"") +endif() |