Skip to content

Commit 8c861c6

Browse files
committed
add tests for char serialization
1 parent 12f4c41 commit 8c861c6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/tests_core_Serialization.cc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,39 @@ TEST(SerialTest, Unsigned64) {
227227
}
228228
}
229229

230+
TEST(SerialTest, Char16) {
231+
char16_t tests[] = {
232+
u'\0',
233+
u'a',
234+
u'é',
235+
u'',
236+
};
237+
238+
char16_t out = 0;
239+
240+
for (auto in : tests) {
241+
save_and_load(in, out);
242+
EXPECT_EQ(in, out);
243+
}
244+
}
245+
246+
TEST(SerialTest, Char32) {
247+
char32_t tests[] = {
248+
U'\0',
249+
U'a',
250+
U'é',
251+
U'',
252+
U'🎮',
253+
};
254+
255+
char32_t out = 0;
256+
257+
for (auto in : tests) {
258+
save_and_load(in, out);
259+
EXPECT_EQ(in, out);
260+
}
261+
}
262+
230263
TEST(SerialTest, Enum) {
231264
enum class Foo : uint8_t {
232265
Bar,

0 commit comments

Comments
 (0)