fix: Array parsing in new config (#1884)

Fixes #1870.
This commit is contained in:
Sergey Kuznetsov
2025-02-12 13:28:06 +00:00
committed by GitHub
parent cd1aa8fb70
commit e503dffc9a
12 changed files with 818 additions and 191 deletions

View File

@@ -31,6 +31,18 @@
using namespace util::config;
TEST(ArrayTest, prefix)
{
EXPECT_EQ(Array::prefix("foo.[]"), "foo.[]");
EXPECT_EQ(Array::prefix("foo.[].bar"), "foo.[]");
EXPECT_EQ(Array::prefix("foo.bar.[].baz"), "foo.bar.[]");
}
TEST(ArrayDeathTest, prefix)
{
EXPECT_DEATH(Array::prefix("foo.bar"), ".*");
}
TEST(ArrayTest, addSingleValue)
{
auto arr = Array{ConfigValue{ConfigType::Double}};