include(cmake_test/cmake_test)

ct_add_test(NAME "test__cpp_serialize_map")
function("${test__cpp_serialize_map}")
    include(cmakepp_lang/serialization/serialization)

    ct_add_section(NAME "empty_map")
    function("${empty_map}")
        cpp_map(CTOR a_map)
        _cpp_serialize_map(result "${a_map}")
        ct_assert_equal(result [[{ }]])
    endfunction()

    ct_add_section(NAME "single_key_val_pair")
    function("${single_key_val_pair}")
        cpp_map(CTOR a_map foo bar)
        _cpp_serialize_map(result "${a_map}")
        ct_assert_equal(result [[{ "foo" : "bar" }]])
    endfunction()

    ct_add_section(NAME "two_key_val_pair")
    function("${two_key_val_pair}")
        cpp_map(CTOR a_map foo bar hello world)
        _cpp_serialize_map(result "${a_map}")
        ct_assert_equal(result [[{ "foo" : "bar", "hello" : "world" }]])
    endfunction()
endfunction()
