aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.ucl/tests/real.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.ucl/tests/real.cc')
-rw-r--r--nihil.ucl/tests/real.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/nihil.ucl/tests/real.cc b/nihil.ucl/tests/real.cc
index d97e767..4bd9b3f 100644
--- a/nihil.ucl/tests/real.cc
+++ b/nihil.ucl/tests/real.cc
@@ -48,12 +48,10 @@ TEST_CASE("ucl: real: parse", "[ucl]")
{
using namespace std::literals;
- auto input = "value = 42.1"sv;
- auto obj = nihil::ucl::parse(input);
- auto v = obj.lookup("value");
- REQUIRE(v);
- REQUIRE(v->key() == "value");
- REQUIRE_THAT(object_cast<nihil::ucl::real>(*v).value(),
+ auto obj = nihil::ucl::parse("value = 42.1"sv);
+ auto v = obj["value"];
+ REQUIRE(v.key() == "value");
+ REQUIRE_THAT(object_cast<nihil::ucl::real>(v).value(),
Catch::Matchers::WithinRel(42.1));
}