Fix issue #2 on GitHub

This commit is contained in:
ktlo
2021-09-28 16:08:55 +00:00
parent 2ddbed3f59
commit 57561c859f
4 changed files with 28 additions and 2 deletions

17
test/issue2.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <sstream>
#include "nbt.hpp"
#include "test.hpp"
using namespace nbt;
test {
std::stringstream input(R"({ "voidByteArray": [B; ] })");
tags::compound_tag root;
input >> contexts::mojangson >> root;
std::string key("voidByteArray");
auto & bytes = root.get<std::vector<std::int8_t>>(key);
assert_true(bytes.empty());
std::cout << contexts::mojangson << root;
}

View File

@@ -1,5 +1,6 @@
test_names = [
'nbt'
'nbt',
'issue2'
]
test_files = []