1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592
|
// This file is a part of toml++ and is subject to the the terms of the MIT license.
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
#include "tests.h"
TOML_DISABLE_SPAM_WARNINGS;
TEST_CASE("path - parsing")
{
SECTION("parsing")
{
CHECK(toml::path("").str() == "");
CHECK(toml::path("[1]").str() == "[1]");
CHECK(toml::path("[1][2]").str() == "[1][2]");
CHECK(toml::path(" [1][2]").str() == " [1][2]");
CHECK(toml::path("a. .b").str() == "a. .b");
CHECK(toml::path("test[23]").str() == "test[23]");
CHECK(toml::path("[ 120 ]").str() == "[120]");
CHECK(toml::path("[ 120\t\t]").str() == "[120]");
CHECK(toml::path("test.value").str() == "test.value");
CHECK(toml::path("test[0].value").str() == "test[0].value");
CHECK(toml::path("test[1][2]\t .value").str() == "test[1][2].value");
CHECK(toml::path("test[1]\t[2].value").str() == "test[1][2].value");
CHECK(toml::path(".test[1][2]\t ..value").str() == ".test[1][2]..value");
#if TOML_ENABLE_WINDOWS_COMPAT
CHECK(toml::path(L"").str() == "");
CHECK(toml::path(L"[1]").str() == "[1]");
CHECK(toml::path(L"[1][2]").str() == "[1][2]");
CHECK(toml::path(L" [1][2]").str() == " [1][2]");
CHECK(toml::path(L"a. .b").str() == "a. .b");
CHECK(toml::path(L"test[23]").str() == "test[23]");
CHECK(toml::path(L"[ 120 ]").str() == "[120]");
CHECK(toml::path(L"[ 120\t\t]").str() == "[120]");
CHECK(toml::path(L"test.value").str() == "test.value");
CHECK(toml::path(L"test[0].value").str() == "test[0].value");
CHECK(toml::path(L"test[1][2]\t .value").str() == "test[1][2].value");
CHECK(toml::path(L"test[1]\t[2].value").str() == "test[1][2].value");
CHECK(toml::path(L".test[1][2]\t ..value").str() == ".test[1][2]..value");
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
SECTION("parsing - errors")
{
CHECK(!toml::path("test[][2].value"));
CHECK(!toml::path("test[ "));
CHECK(!toml::path("test[1]a.b"));
CHECK(!toml::path("test[1] a.b"));
CHECK(!toml::path("test[1a]"));
CHECK(!toml::path("test[a1]"));
CHECK(!toml::path("test[1!]"));
CHECK(!toml::path("test[!1]"));
CHECK(!toml::path("test[1 2]"));
CHECK(!toml::path("test[1.2]"));
CHECK(!toml::path("test[0.2]"));
#if TOML_ENABLE_WINDOWS_COMPAT
CHECK(!toml::path(L"test[][2].value"));
CHECK(!toml::path(L"test[ "));
CHECK(!toml::path(L"test[1]a.b"));
CHECK(!toml::path(L"test[1] a.b"));
CHECK(!toml::path(L"test[1a]"));
CHECK(!toml::path(L"test[a1]"));
CHECK(!toml::path(L"test[1!]"));
CHECK(!toml::path(L"test[!1]"));
CHECK(!toml::path(L"test[1 2]"));
CHECK(!toml::path(L"test[1.2]"));
CHECK(!toml::path(L"test[0.2]"));
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
SECTION("parsing from literal")
{
auto p0 = "a.b.c[1][12]"_tpath;
CHECK(p0);
CHECK(p0.str() == "a.b.c[1][12]");
CHECK("ab.cd[1]"_tpath == toml::path("ab.cd[1]"));
CHECK(("an.invalid.path[a1]"_tpath).str() == "");
}
}
TEST_CASE("path - manipulating")
{
SECTION("parent_node and truncation")
{
toml::path p0("");
CHECK(p0.parent().str() == "");
toml::path p1("start.middle.end");
CHECK(p1.parent().str() == "start.middle");
CHECK(p1.parent().parent().str() == "start");
CHECK(p1.parent().parent().parent().str() == "");
CHECK(p1.parent().parent().parent().parent().str() == "");
toml::path p2("[1][2][3]");
CHECK(p2.parent().str() == "[1][2]");
CHECK(p2.parent().parent().str() == "[1]");
CHECK(p2.parent().parent().parent().str() == "");
toml::path p3(".test");
CHECK(p3.parent().str() == "");
toml::path p4("test..");
CHECK(p4.parent().str() == "test.");
CHECK(p4.parent().parent().str() == "test");
CHECK(p4.parent().parent().parent().str() == "");
toml::path p5("test.key[12].subkey");
CHECK(p5.parent().str() == "test.key[12]");
CHECK(p5.parent().parent().str() == "test.key");
CHECK(p5.parent().parent().parent().str() == "test");
CHECK(p5.parent().parent().parent().parent().str() == "");
toml::path p6("test.key1.key2.key3.key4");
CHECK(p6.truncated(0).str() == "test.key1.key2.key3.key4");
CHECK(p6.truncated(1).str() == "test.key1.key2.key3");
CHECK(p6.truncated(4).str() == "test");
CHECK(p6.truncated(5).str() == "");
CHECK(p6.truncated(20).str() == "");
CHECK(p6.str() == "test.key1.key2.key3.key4");
p6.truncate(0);
CHECK(p6.str() == "test.key1.key2.key3.key4");
p6.truncate(2);
CHECK(p6.str() == "test.key1.key2");
p6.truncate(3);
CHECK(p6.str() == "");
}
SECTION("subpath")
{
toml::path p0("a.simple[1].path[2].object");
CHECK(p0.subpath(p0.begin() + 1, p0.begin() + 4).str() == "simple[1].path");
CHECK(p0.subpath(p0.begin() + 1, p0.end() - 1).str() == "simple[1].path[2]");
CHECK(p0.subpath(p0.begin(), p0.begin()).str() == "");
CHECK(p0.subpath(p0.begin(), p0.end() - 5).str() == "a");
CHECK(p0.subpath(p0.begin() + 2, p0.end() - 1).str() == "[1].path[2]");
CHECK(p0.subpath(p0.begin() + 5, p0.end() - 5).str() == "");
CHECK(!p0.subpath(p0.end(), p0.begin()));
CHECK(p0.subpath(1, 4).str() == "simple[1].path[2]");
CHECK(p0.subpath(0, 0).str() == "");
CHECK(p0.subpath(2, 0).str() == "");
CHECK(p0.subpath(2, 1).str() == "[1]");
}
SECTION("leaf")
{
toml::path p0("one.two.three.four.five");
CHECK(p0.leaf(0).str() == "");
CHECK(p0.leaf().str() == "five");
CHECK(p0.leaf(3).str() == "three.four.five");
CHECK(p0.leaf(5).str() == "one.two.three.four.five");
CHECK(p0.leaf(10).str() == "one.two.three.four.five");
toml::path p1("[10][2][30][4][50]");
CHECK(p1.leaf(0).str() == "");
CHECK(p1.leaf().str() == "[50]");
CHECK(p1.leaf(3).str() == "[30][4][50]");
CHECK(p1.leaf(5).str() == "[10][2][30][4][50]");
CHECK(p1.leaf(10).str() == "[10][2][30][4][50]");
toml::path p2("one[1].two.three[3]");
CHECK(p2.leaf(0).str() == "");
CHECK(p2.leaf().str() == "[3]");
CHECK(p2.leaf(3).str() == "two.three[3]");
CHECK(p2.leaf(4).str() == "[1].two.three[3]");
CHECK(p2.leaf(10).str() == "one[1].two.three[3]");
}
SECTION("append - string")
{
toml::path p0("start");
CHECK(p0.size() == 1u);
CHECK(p0.append("middle.end").str() == "start.middle.end");
CHECK(p0.append("[12]").str() == "start.middle.end[12]");
toml::path p1("");
CHECK(p1.size() == 1u);
p1.append("[1].key"sv);
CHECK(p1.size() == 3u);
CHECK(p1.str() == "[1].key"sv);
#if TOML_ENABLE_WINDOWS_COMPAT
toml::path p2("start");
CHECK(p2.size() == 1u);
CHECK(p2.append(L"middle.end").str() == "start.middle.end");
CHECK(p2.append(L"[12]").str() == "start.middle.end[12]");
toml::path p3("");
CHECK(p3.append(L"[1].key").str() == "[1].key");
#endif // TOML_ENABLE_WINDOWS_COMPAT
toml::path p4;
CHECK(p4.size() == 0u);
CHECK(p4.append("[1].key").str() == "[1].key");
}
SECTION("append - toml::path copy")
{
toml::path p0("start");
toml::path appendee1("middle.end");
toml::path appendee2("[12]");
CHECK(p0.append(appendee1).str() == "start.middle.end");
CHECK(p0.append(appendee2).str() == "start.middle.end[12]");
// Ensure copies and not moves
CHECK(appendee1.str() == "middle.end");
CHECK(appendee2.str() == "[12]");
toml::path p1("");
toml::path appendee3("[1].key");
CHECK(p1.append(appendee3).str() == "[1].key");
// Ensure copies and not moves
CHECK(appendee3.str() == "[1].key");
}
SECTION("append - toml::path move")
{
toml::path p0("start");
CHECK(p0.append(toml::path{ "middle.end" }).str() == "start.middle.end");
CHECK(p0.append(toml::path{ "[12]" }).str() == "start.middle.end[12]");
toml::path p1("");
CHECK(p1.size() == 1u);
CHECK(p1.append(toml::path{ "[1].key" }).str() == "[1].key");
toml::path p2;
CHECK(p2.size() == 0u);
CHECK(p2.append(toml::path{ "[1].key" }).str() == "[1].key");
}
SECTION("prepend - string")
{
toml::path p0("start");
CHECK(p0.prepend("middle.end").str() == "middle.end.start");
CHECK(p0.prepend("[12]").str() == "[12].middle.end.start");
toml::path p1;
CHECK(p1.prepend("[1].key").str() == "[1].key");
toml::path p2("");
CHECK(p2.prepend("[1].key").str() == "[1].key.");
#if TOML_ENABLE_WINDOWS_COMPAT
toml::path p3("start");
CHECK(p3.prepend(L"middle.end").str() == "middle.end.start");
CHECK(p3.prepend(L"[12]").str() == "[12].middle.end.start");
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
SECTION("prepend - toml::path copy")
{
toml::path p0("start");
toml::path prependee1("middle.end");
toml::path prependee2("[12]");
CHECK(p0.prepend(prependee1).str() == "middle.end.start");
CHECK(p0.prepend(prependee2).str() == "[12].middle.end.start");
// Ensure copies and not moves
CHECK(prependee1.str() == "middle.end");
CHECK(prependee2.str() == "[12]");
toml::path p1;
toml::path prependee3("[1].key");
CHECK(p1.prepend(prependee3).str() == "[1].key");
// Ensure copies and not moves
CHECK(prependee3.str() == "[1].key");
}
SECTION("prepend - toml::path move")
{
toml::path p0("start");
CHECK(p0.prepend(toml::path("middle.end")).str() == "middle.end.start");
CHECK(p0.prepend(toml::path("[12]")).str() == "[12].middle.end.start");
toml::path p1;
CHECK(p1.prepend(toml::path("[1].key")).str() == "[1].key");
}
SECTION("alter components")
{
toml::path p0("start.mid[1][2].end");
p0[3] = std::size_t{ 13 };
CHECK(p0.str() == "start.mid[1][13].end");
p0[0] = 2u;
CHECK(p0.str() == "[2].mid[1][13].end");
p0[0] = 10;
CHECK(p0.str() == "[10].mid[1][13].end");
p0[3] = "newkey";
CHECK(p0.str() == "[10].mid[1].newkey.end");
}
SECTION("assign")
{
toml::path p0("start.mid[1][2].end");
p0.assign("test.key[1]");
CHECK(p0.str() == "test.key[1]");
p0.assign("");
CHECK(p0.str() == "");
toml::path p1("a.test.path[1]");
p1.assign("invalid[abc]");
CHECK(!p1);
CHECK(p1.str() == "");
toml::path p2("another[1].test.path");
p2.assign(toml::path("test"));
CHECK(p2.str() == "test");
p2.assign(toml::path(""));
CHECK(p2.str() == "");
toml::path p3("final.test[1]");
p3.assign(toml::path("invalid[abc"));
CHECK(!p3);
CHECK(p3.str() == "");
#if TOML_ENABLE_WINDOWS_COMPAT
toml::path p4("start.mid[1][2].end");
p4.assign(L"test.key[1]");
CHECK(p4.str() == "test.key[1]");
p4.assign("");
CHECK(p4.str() == "");
toml::path p5("a.test.path[1]");
p5.assign("invalid[abc]");
CHECK(!p5);
CHECK(p5.str() == "");
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
}
TEST_CASE("path - operators")
{
SECTION("object equality")
{
CHECK(toml::path("a.b.c") == toml::path("a.b.c"));
CHECK(toml::path("[1].a") == toml::path("[1].a"));
CHECK(toml::path("a.b.c") != toml::path("a.b"));
CHECK(toml::path("[1].b") != toml::path("[1].b.c"));
}
SECTION("string equality")
{
CHECK(toml::path("a.b.c") == "a.b.c");
CHECK(toml::path("[1].a") == "[1].a");
CHECK(toml::path("a.b.c") != "a.b");
CHECK(toml::path("[1].b") != "[1].b.c");
#if TOML_ENABLE_WINDOWS_COMPAT
CHECK(toml::path("a.b.c") == L"a.b.c");
CHECK(toml::path("[1].a") == L"[1].a");
CHECK(toml::path("a.b.c") != L"a.b");
CHECK(toml::path("[1].b") != L"[1].b.c");
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
SECTION("arithmetic")
{
CHECK(toml::path("a.b.c") + "a[1]" == "a.b.c.a[1]");
CHECK((toml::path("a.b.c") + "a[1]") == "a.b.c.a[1]");
CHECK(toml::path("a.b.c") + toml::path("a[1]") == "a.b.c.a[1]");
toml::path p1("a.b");
toml::path p2("c[1]");
CHECK(p1 + p2 == "a.b.c[1]");
CHECK(p1 + "c[1]" == "a.b.c[1]");
CHECK("a.b" + p2 == "a.b.c[1]");
#if TOML_ENABLE_WINDOWS_COMPAT
CHECK(toml::path("a.b.c") + L"a[1]" == "a.b.c.a[1]");
CHECK(p1 + L"c[1]" == "a.b.c[1]");
CHECK(L"a.b" + p2 == "a.b.c[1]");
#endif // TOML_ENABLE_WINDOWS_COMPAT
}
}
TEST_CASE("path - misc")
{
CHECK(toml::path{ "" }.str() == "");
CHECK(toml::path{ "a" }.str() == "a");
CHECK(toml::path{ "a.b" }.str() == "a.b");
CHECK(toml::path{ "a.b.c" }.str() == "a.b.c");
CHECK(toml::path{ ".a.b.c" }.str() == ".a.b.c");
CHECK(toml::path{}.empty());
CHECK(!toml::path{ "" }.empty());
CHECK(!toml::path{ "a" }.empty());
CHECK(static_cast<std::string>(toml::path("a.b[1]")) == "a.b[1]");
CHECK(static_cast<bool>(toml::path("a.b[1]")));
CHECK(!static_cast<bool>(toml::path("a.b[a b]")));
#if TOML_ENABLE_WINDOWS_COMPAT
CHECK(static_cast<std::wstring>(toml::path("a.b[1]")) == L"a.b[1]");
#endif
}
TEST_CASE("path - accessing")
{
// clang-format off
const auto tbl = table
{
{ ""sv, 0 }, // blank key
{ "a"sv, 1 },
{
"b"sv,
array
{
2,
array{ 3 },
table { { "c", 4 } }
},
},
{ "d", table{ {"e", 5, }, {""sv, -1 } } }
};
// clang-format on
/*
# equivalent to the following TOML:
"" = 0
a = 1
b = [
2,
[ 3 ],
{ "c" = 4 }
]
d = { "e" = 5, "" = -1 }
*/
SECTION("table")
{
// this section uses the free function version of at_path
CHECK(tbl[""]);
CHECK(tbl[""] == at_path(tbl, toml::path("")));
CHECK(tbl["a"]);
CHECK(tbl["a"] == at_path(tbl, toml::path("a")));
CHECK(tbl["a"] != at_path(tbl, toml::path(".a"))); // equivalent to ""."a"
CHECK(!at_path(tbl, toml::path(".a")));
CHECK(tbl["b"]);
CHECK(tbl["b"] == at_path(tbl, toml::path("b")));
CHECK(tbl["b"][0]);
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[0]")));
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[0] ")));
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[ 0\t]"))); // whitespace is allowed inside array indexer
CHECK(tbl["b"][1]);
CHECK(tbl["b"][1] != tbl["b"][0]);
CHECK(tbl["b"][1] == at_path(tbl, toml::path("b[1]")));
CHECK(tbl["b"][1][0]);
CHECK(tbl["b"][1][0] == at_path(tbl, toml::path("b[1][0]")));
CHECK(tbl["b"][1][0] == at_path(tbl, toml::path("b[1] \t [0]"))); // whitespace is allowed after array
// indexers
CHECK(tbl["b"][2]["c"]);
CHECK(tbl["b"][2]["c"] == at_path(tbl, toml::path("b[2].c")));
CHECK(tbl["b"][2]["c"] == at_path(tbl, toml::path("b[2] \t.c"))); // whitespace is allowed after array
// indexers
CHECK(tbl["d"]);
CHECK(tbl["d"] == at_path(tbl, toml::path("d")));
CHECK(tbl["d"]["e"]);
CHECK(tbl["d"]["e"] == at_path(tbl, toml::path("d.e")));
CHECK(tbl["d"]["e"] != at_path(tbl, toml::path("d. e"))); // equivalent to "d"." e"
CHECK(!at_path(tbl, toml::path("d. e")));
CHECK(tbl["d"][""]);
CHECK(tbl["d"][""] == at_path(tbl, toml::path("d.")));
CHECK(!at_path(tbl, toml::path("has.missing.component")));
}
SECTION("array")
{
// this section uses the node_view member function version of at_path
auto arr = tbl["b"];
CHECK(tbl["b"][0]);
CHECK(tbl["b"][0] == arr.at_path(toml::path("[0]")));
CHECK(tbl["b"][0] == arr.at_path(toml::path("[0] ")));
CHECK(tbl["b"][0] == arr.at_path(toml::path("[ 0\t]"))); // whitespace is allowed inside array indexer
CHECK(tbl["b"][1]);
CHECK(tbl["b"][1].node() != arr[0].node());
CHECK(tbl["b"][1] == arr.at_path(toml::path("[1]")));
CHECK(tbl["b"][1][0]);
CHECK(tbl["b"][1][0] == arr.at_path(toml::path("[1][0]")));
CHECK(tbl["b"][1][0] == arr.at_path(toml::path("[1] \t [0]"))); // whitespace is allowed after array
// indexers
CHECK(tbl["b"][2]["c"]);
CHECK(tbl["b"][2]["c"] == arr.at_path(toml::path("[2].c")));
CHECK(tbl["b"][2]["c"] == arr.at_path(toml::path("[2] \t.c"))); // whitespace is allowed after array indexers
CHECK(!arr.at_path(toml::path("[3].missing.component")));
}
SECTION("indexing operator")
{
// this section uses the operator[] of table and node_view
CHECK(tbl[""]);
CHECK(tbl[""] == tbl[toml::path("")]);
CHECK(tbl["a"]);
CHECK(tbl["a"] == tbl[toml::path("a")]);
CHECK(tbl["a"] != tbl[toml::path(".a")]); // equivalent to ""."a"
CHECK(!tbl[toml::path(".a")]);
CHECK(tbl["b"]);
CHECK(tbl["b"] == tbl[toml::path("b")]);
CHECK(tbl["b"][0]);
CHECK(tbl["b"][0] == tbl[toml::path("b[0]")]);
CHECK(tbl["b"][0] == tbl[toml::path("b[0] ")]);
CHECK(tbl["b"][0] == tbl[toml::path("b[ 0\t]")]); // whitespace is allowed inside array indexer
CHECK(tbl["b"][1]);
CHECK(tbl["b"][1] != tbl[toml::path("b")][0]);
CHECK(tbl["b"][1] == tbl[toml::path("b[1]")]);
CHECK(tbl["b"][1][0]);
CHECK(tbl["b"][1][0] == tbl[toml::path("b[1]")][0]);
CHECK(tbl["b"][1][0] == tbl[toml::path("b[1] \t [0]")]); // whitespace is allowed after array
// indexers
CHECK(tbl["b"][2]["c"]);
CHECK(tbl["b"][2]["c"] == tbl[toml::path("b")][toml::path("[2].c")]);
CHECK(tbl["b"][2]["c"] == tbl[toml::path("b[2] \t.c")]); // whitespace is allowed after array
// indexers
CHECK(tbl["d"]);
CHECK(tbl["d"] == tbl[toml::path("d")]);
CHECK(tbl["d"]["e"]);
CHECK(tbl["d"]["e"] == tbl[toml::path("d.e")]);
CHECK(tbl["d"]["e"] != tbl[toml::path("d. e")]); // equivalent to "d"." e"
CHECK(!tbl[toml::path("d. e")]);
CHECK(tbl["d"][""]);
CHECK(tbl["d"][""] == tbl[toml::path("d.")]);
CHECK(!tbl[toml::path("has.missing.component")]);
}
}
|