diff --git a/include/xcpp/xmime.hpp b/include/xcpp/xmime.hpp index e849a98d..030b9985 100644 --- a/include/xcpp/xmime.hpp +++ b/include/xcpp/xmime.hpp @@ -40,7 +40,7 @@ namespace xcpp template nl::json mime_bundle_repr(const T& value) { - return detail::mime_bundle_repr_via_sstream(&value); + return detail::mime_bundle_repr_via_sstream(value); } } diff --git a/test/test_interpreter.cpp b/test/test_interpreter.cpp index 003d7024..cfb0d7d5 100644 --- a/test/test_interpreter.cpp +++ b/test/test_interpreter.cpp @@ -15,6 +15,7 @@ #include "xeus-cpp/xutils.hpp" #include "xeus-cpp/xoptions.hpp" #include "xeus-cpp/xeus_cpp_config.hpp" +#include "xcpp/xmime.hpp" #include "../src/xparser.hpp" #include "../src/xsystem.hpp" @@ -1079,3 +1080,17 @@ TEST_SUITE("file") { infile.close(); } } + +TEST_SUITE("mime_bundle_repr") +{ + TEST_CASE("int") + { + int value = 42; + nl::json res = xcpp::mime_bundle_repr(value); + nl::json expected = { + {"text/plain", "42"} + }; + + REQUIRE(res == expected); + } +}