From d26800bc40a103d90366da176ad68ed92f21daab Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Jun 2013 11:17:20 -0400 Subject: [PATCH] get_filename_component: Test ABSOLUTE of .. after root component Teach the RunCMake.get_filename_component test to verify that ".." does not remove the root filename component. --- Tests/RunCMake/get_filename_component/KnownComponents.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake index a4ef8ff98..9d7cf9079 100644 --- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake +++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake @@ -24,6 +24,11 @@ check("DIRECTORY in windows root" "${test_winroot}" "c:/") get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE) check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") +get_filename_component(test_absolute "/../path/to/filename.ext.in" ABSOLUTE) +check("ABSOLUTE .. in root" "${test_absolute}" "/path/to/filename.ext.in") +get_filename_component(test_absolute "c:/../path/to/filename.ext.in" ABSOLUTE) +check("ABSOLUTE .. in windows root" "${test_absolute}" "c:/path/to/filename.ext.in") + get_filename_component(test_cache "/path/to/filename.ext.in" DIRECTORY CACHE) check("CACHE 1" "${test_cache}" "/path/to") get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE)