Adding tests for issue 2017 (#2018)

This commit is contained in:
Daniel Lemire
2023-06-07 09:57:28 -04:00
committed by GitHub
parent 74bb7b2533
commit 65f9822542
2 changed files with 27 additions and 2 deletions
+11 -1
View File
@@ -66,6 +66,15 @@ namespace number_tests {
return true;
}
bool issue2017() {
TEST_START();
simdjson::dom::parser parser;
simdjson::padded_string docdata = R"({"score":0.8825149536132812})"_padded;
double score;
ASSERT_SUCCESS(parser.parse(docdata)["score"].get_double().get(score));
ASSERT_EQUAL(score, 0.8825149536132812);
TEST_SUCCEED();
}
bool small_integers() {
std::cout << __func__ << std::endl;
@@ -377,7 +386,8 @@ namespace number_tests {
}
bool run() {
return truncated_borderline() &&
return issue2017() &&
truncated_borderline() &&
specific_tests() &&
ground_truth() &&
small_integers() &&
+16 -1
View File
@@ -333,6 +333,8 @@ namespace number_tests {
TEST_SUCCEED();
}
bool get_root_number_tests() {
TEST_START();
ondemand::parser parser;
@@ -389,8 +391,21 @@ namespace number_tests {
TEST_SUCCEED();
}
bool issue2017() {
TEST_START();
ondemand::parser parser;
ondemand::document doc;
padded_string docdata = R"({"score":0.8825149536132812})"_padded;
ASSERT_SUCCESS(parser.iterate(docdata).get(doc));
double score;
ASSERT_SUCCESS(doc["score"].get_double().get(score));
ASSERT_EQUAL(score, 0.8825149536132812);
TEST_SUCCEED();
}
bool run() {
return issue_1898() &&
return issue2017() &&
issue_1898() &&
issue1878() &&
get_root_number_tests() &&
get_number_tests()&&