Skip to content

Commit 71c8cb7

Browse files
authored
Merge pull request #67 from branan/maint/pending_tests
(maint) Fixup pending tests that actually pass
2 parents 5e940eb + 4eea1ed commit 71c8cb7

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

lib/tests/conf_parser_test.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,6 @@ TEST_CASE("implied comma handling") {
246246
REQUIRE_THROWS_AS(parse_config("{ a : y b : z }"), config_exception);
247247

248248
REQUIRE_THROWS_AS(parse_config(R"({ "a" : "y" "b" : "z" })"), config_exception);
249-
}
250-
251-
TEST_CASE("implied comma handling (pending)", "[!shouldfail]") {
252-
// TODO: remaining tests require list accessors
253249

254250
// with no newline or comma, we do value concatenation
255251
auto no_newline_in_array = parse_config(" { c : [ 1 2 3 ] } ");
@@ -709,7 +705,7 @@ TEST_CASE("include file unclosed parens") {
709705
// accept bom in string value
710706
// accept bom whitespace
711707

712-
TEST_CASE("accept multi period numeric path (pending)", "[!shouldfail]") {
708+
TEST_CASE("accept multi period numeric path") {
713709
auto conf1 = config::parse_string("0.1.2.3=foobar1");
714710
REQUIRE("foobar1" == conf1->get_string("0.1.2.3"));
715711
auto conf2 = config::parse_string("0.1.2.3.ABC=foobar2");

lib/tests/config_substitution_test.cc

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ z = 15
491491
REQUIRE(15 == resolved->get_int("item1.n.o.p"));
492492
}
493493

494-
TEST_CASE("(pending HC-78) fetch known value from delayed merge object", "[!shouldfail]") {
494+
TEST_CASE("Fetch known value from delayed merge object") {
495495
auto obj = parse_object(R"(
496496
defaults {
497497
a = 1
@@ -509,7 +509,7 @@ defaults {
509509
REQUIRE(3 == obj->to_config()->get_config("item1")->get_int("b"));
510510
}
511511

512-
TEST_CASE("(peding HC-78) fail to fetch from delayed merge object needs full resolve", "[!shouldfail]") {
512+
TEST_CASE("Fail to fetch from delayed merge object needs full resolve") {
513513
auto obj = parse_object(R"(
514514
defaults {
515515
a = 1
@@ -674,15 +674,15 @@ TEST_CASE("optional override of object provided") {
674674
REQUIRE_FALSE(resolved->has_path("a.b"));
675675
}
676676

677-
// TODO: Uncomment this test and write optionalUsedInArray when config::get_*_list are implemented: HC-75
678-
TEST_CASE("pending HC-75: optional vanishes from array (pending)", "[!shouldfail]") {
677+
TEST_CASE("optional vanishes from array") {
679678
auto obj = parse_object("{ a : [ 1, 2, 3, ${?NOT_HERE} ] }");
680679
auto resolved = resolve(obj);
681680
auto list = vector<int> {1,2,3};
682681
REQUIRE(list == resolved->get_int_list("a"));
683682
}
684683

685-
TEST_CASE("subst self references (pending)", "[!shouldfail]") {
684+
685+
TEST_CASE("subst self references") {
686686
SECTION("subst self reference") {
687687
auto obj = parse_object("a=1, a=${a}");
688688
auto resolved = resolve(obj);
@@ -764,14 +764,6 @@ TEST_CASE("subst self references (pending)", "[!shouldfail]") {
764764
REQUIRE(2u == resolved->get_int("a"));
765765
}
766766

767-
// TODO: this test legitimately fails: HC-76
768-
SECTION("pending HC-76: subst self reference object middle of stack", "[!shouldfail]") {
769-
auto obj = parse_object("a={b=5}, a=${a}, a={c=6}");
770-
auto resolved = resolve(obj);
771-
REQUIRE(5u == resolved->get_int("a.b"));
772-
REQUIRE(6u == resolved->get_int("a.c"));
773-
}
774-
775767
SECTION("subst optional self reference middle of stack") {
776768
auto obj = parse_object("a=1, a=${?a}, a=2");
777769
auto resolved = resolve(obj);
@@ -867,19 +859,6 @@ TEST_CASE("subst self references (pending)", "[!shouldfail]") {
867859
REQUIRE(3u == resolved->get_int("foo.c"));
868860
}
869861

870-
// TODO: these tests legitimately fail: HC-77
871-
SECTION("pending HC-77: subst self reference multiple times", "[!shouldfail]") {
872-
auto obj = parse_object("a=1,a=${a},a=${a},a=${a}");
873-
auto resolved = resolve(obj);
874-
REQUIRE(1u == resolved->get_int("a"));
875-
}
876-
877-
SECTION("pending HC-77: subst self reference in concat multiple times", "[!shouldfail]") {
878-
auto obj = parse_object("a=1,a=${a}x,a=${a}y,a=${a}z");
879-
auto resolved = resolve(obj);
880-
REQUIRE("1xyz" == resolved->get_string("a"));
881-
}
882-
883862
SECTION("subst self reference in array") {
884863
// never "look back" from "inside" an array
885864
bool thrown = false;
@@ -892,4 +871,27 @@ TEST_CASE("subst self references (pending)", "[!shouldfail]") {
892871
}
893872
REQUIRE(thrown);
894873
}
895-
}
874+
}
875+
876+
TEST_CASE("subst self references (pending)", "[!shouldfail]") {
877+
// TODO: this test legitimately fails: HC-76
878+
SECTION("pending HC-76: subst self reference object middle of stack", "[!shouldfail]") {
879+
auto obj = parse_object("a={b=5}, a=${a}, a={c=6}");
880+
auto resolved = resolve(obj);
881+
REQUIRE(5u == resolved->get_int("a.b"));
882+
REQUIRE(6u == resolved->get_int("a.c"));
883+
}
884+
885+
// TODO: these tests legitimately fail: HC-77
886+
SECTION("pending HC-77: subst self reference multiple times", "[!shouldfail]") {
887+
auto obj = parse_object("a=1,a=${a},a=${a},a=${a}");
888+
auto resolved = resolve(obj);
889+
REQUIRE(1u == resolved->get_int("a"));
890+
}
891+
892+
SECTION("pending HC-77: subst self reference in concat multiple times", "[!shouldfail]") {
893+
auto obj = parse_object("a=1,a=${a}x,a=${a}y,a=${a}z");
894+
auto resolved = resolve(obj);
895+
REQUIRE("1xyz" == resolved->get_string("a"));
896+
}
897+
}

0 commit comments

Comments
 (0)