From 2967cebfb317a7ee88ac8874b251989f4e85d6ed Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 26 Apr 2019 16:31:59 +0900 Subject: [PATCH] test: add test to get a toml::value as string_view --- tests/test_get.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_get.cpp b/tests/test_get.cpp index b9c5941..833c479 100644 --- a/tests/test_get.cpp +++ b/tests/test_get.cpp @@ -12,6 +12,9 @@ #include #include #include +#if __cplusplus >= 201703L +#include +#endif BOOST_AUTO_TEST_CASE(test_get_exact) @@ -166,6 +169,17 @@ BOOST_AUTO_TEST_CASE(test_get_string_type) toml::get(v) += "bar"; BOOST_CHECK_EQUAL("foobar", toml::get(v)); } + +#if __cplusplus >= 201703L + { + toml::value v("foo", toml::string_t::basic); + BOOST_CHECK_EQUAL("foo", toml::get(v)); + } + { + toml::value v("foo", toml::string_t::literal); + BOOST_CHECK_EQUAL("foo", toml::get(v)); + } +#endif } BOOST_AUTO_TEST_CASE(test_get_toml_array)