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.
This commit is contained in:
Brad King 2013-06-03 11:17:20 -04:00
parent c91e88d0e1
commit d26800bc40
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,11 @@ check("DIRECTORY in windows root" "${test_winroot}" "c:/")
get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE) get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE)
check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") 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) get_filename_component(test_cache "/path/to/filename.ext.in" DIRECTORY CACHE)
check("CACHE 1" "${test_cache}" "/path/to") check("CACHE 1" "${test_cache}" "/path/to")
get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE) get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE)