From 7c9c42329e453c0c1e70ec37efcf5375065b3567 Mon Sep 17 00:00:00 2001 From: YongDo-Hyun Date: Sat, 27 Dec 2025 01:16:53 +0300 Subject: fix: prevent widening of stored tag type in value assignment; update test output handling Signed-off-by: YongDo-Hyun --- test/format_test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/format_test.cpp') diff --git a/test/format_test.cpp b/test/format_test.cpp index 1a689ed3f2..ed8d2d1bfc 100644 --- a/test/format_test.cpp +++ b/test/format_test.cpp @@ -87,15 +87,17 @@ int main() // Write to file and read back { + tag_compound file_comp = comp; + file_comp.erase("null"); std::ofstream out("test_output.nbt", std::ios::binary); - nbt::io::write_compound(out, comp); + nbt::io::write_tag("root", file_comp, out); } { std::ifstream in("test_output.nbt", std::ios::binary); - auto [read_comp, name] = nbt::io::read_compound(in); + auto read_pair = nbt::io::read_compound(in); std::cout << "----- read back from file:\n"; - std::cout << read_comp; + std::cout << *read_pair.second; std::cout << "\n-----" << std::endl; } -- cgit 0.0.5-2-1-g0f52