Skip to content

Commit 9a4af34

Browse files
authored
Fixed default mime_bundle_repr (#398)
1 parent 6117076 commit 9a4af34

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

include/xcpp/xmime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace xcpp
4040
template <class T>
4141
nl::json mime_bundle_repr(const T& value)
4242
{
43-
return detail::mime_bundle_repr_via_sstream(&value);
43+
return detail::mime_bundle_repr_via_sstream(value);
4444
}
4545
}
4646

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if(EMSCRIPTEN)
7070
PUBLIC "SHELL: -fexceptions"
7171
PUBLIC "SHELL: -s MAIN_MODULE=1"
7272
PUBLIC "SHELL: -s WASM_BIGINT"
73-
PUBLIC "SHELL: -s ASSERTIONS=0"
73+
PUBLIC "SHELL: -s ASSERTIONS=1"
7474
PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1"
7575
PUBLIC "SHELL: -s STACK_SIZE=32mb"
7676
PUBLIC "SHELL: -s INITIAL_MEMORY=128mb"

test/test_interpreter.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "xeus-cpp/xutils.hpp"
1616
#include "xeus-cpp/xoptions.hpp"
1717
#include "xeus-cpp/xeus_cpp_config.hpp"
18+
#include "xcpp/xmime.hpp"
1819

1920
#include "../src/xparser.hpp"
2021
#include "../src/xsystem.hpp"
@@ -1079,3 +1080,17 @@ TEST_SUITE("file") {
10791080
infile.close();
10801081
}
10811082
}
1083+
1084+
TEST_SUITE("mime_bundle_repr")
1085+
{
1086+
TEST_CASE("int")
1087+
{
1088+
int value = 42;
1089+
nl::json res = xcpp::mime_bundle_repr(value);
1090+
nl::json expected = {
1091+
{"text/plain", "42"}
1092+
};
1093+
1094+
REQUIRE(res == expected);
1095+
}
1096+
}

0 commit comments

Comments
 (0)