diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-22 23:25:26 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-22 23:25:26 +0100 |
| commit | 8cbb82a1f6eb6605a4615d30922b777e7bf1e4d8 (patch) | |
| tree | c79559e81aa9570e22a13ec0439ff7eee05f9ffd /nihil.ucl/tests/real.cc | |
| parent | 639b270eed81f7c2627d810057d188e2e8ee67f9 (diff) | |
| download | nihil-8cbb82a1f6eb6605a4615d30922b777e7bf1e4d8.tar.gz nihil-8cbb82a1f6eb6605a4615d30922b777e7bf1e4d8.tar.bz2 | |
nihil.ucl: add map<>
Diffstat (limited to 'nihil.ucl/tests/real.cc')
| -rw-r--r-- | nihil.ucl/tests/real.cc | 10 |
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)); } |
