summaryrefslogtreecommitdiffstats
path: root/Tests/Unset
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Unset')
-rw-r--r--Tests/Unset/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt
index 07aa68e..a40367b 100644
--- a/Tests/Unset/CMakeLists.txt
+++ b/Tests/Unset/CMakeLists.txt
@@ -21,17 +21,26 @@ set(x 43)
if(NOT x EQUAL 43)
message(FATAL_ERROR "x!=43")
endif()
+if(DEFINED CACHE{x})
+ message(FATAL_ERROR "x shouldn't be found in the cache")
+endif()
+
set(x)
if(DEFINED x)
message(FATAL_ERROR "x should be undefined now!")
endif()
+
# Cache variable
set(BAR "test" CACHE STRING "documentation")
if(NOT DEFINED BAR)
message(FATAL_ERROR "BAR not defined")
endif()
+if(NOT DEFINED CACHE{BAR})
+ message(FATAL_ERROR "BAR could not be found by CACHE{BAR}")
+endif()
+
# Test interaction of cache entries with variables.
set(BAR "test-var")
if(NOT "$CACHE{BAR}" STREQUAL "test")