include(cmake_test/cmake_test)

ct_add_test(NAME "_test_sanitize_name")
function(${_test_sanitize_name})
    include(cmake_test/detail_/utilities/sanitize_name)

    ct_add_section(NAME "_sanitize_already_fine")
    function(${_sanitize_already_fine})
        _ct_sanitize_name(result "already_good")
        ct_assert_equal(result "already_good")
    endfunction()

    ct_add_section(NAME "_sanitize_forces_lowercase")
    function(${_sanitize_forces_lowercase})
        _ct_sanitize_name(result "SCREAMING")
        ct_assert_equal(result "screaming")
    endfunction()

    ct_add_section(NAME "_sanitize_replaces_spaces")
    function(${_sanitize_replaces_spaces})
        _ct_sanitize_name(result "has two spaces")
        ct_assert_equal(result "has_two_spaces")
    endfunction()

    ct_add_section(NAME "_sanitize_replaces_semicolons")
    function(${_sanitize_replaces_semicolons})
        _ct_sanitize_name(result "has:")
        ct_assert_equal(result "has_")
    endfunction()
endfunction()
