aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.ucl/tests
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-29 17:16:22 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-29 17:16:22 +0100
commit4fa6821e0645ff61a9380cd090abff472205c630 (patch)
treebd95f13b2dc0bd9692681f50c365d2914a520bfe /nihil.ucl/tests
parente5180acf5f2dfac788e8c12886095ed1ac66fae5 (diff)
downloadnihil-4fa6821e0645ff61a9380cd090abff472205c630.tar.gz
nihil-4fa6821e0645ff61a9380cd090abff472205c630.tar.bz2
add clang-tidy support
Diffstat (limited to 'nihil.ucl/tests')
-rw-r--r--nihil.ucl/tests/map.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/nihil.ucl/tests/map.cc b/nihil.ucl/tests/map.cc
index 5d2fbe1..7240cb3 100644
--- a/nihil.ucl/tests/map.cc
+++ b/nihil.ucl/tests/map.cc
@@ -9,6 +9,8 @@
import nihil.ucl;
+//NOLINTBEGIN(bugprone-unchecked-optional-access)
+
TEST_CASE("ucl: map: invariants", "[ucl]")
{
using namespace nihil::ucl;
@@ -110,11 +112,10 @@ TEST_CASE("ucl: map: find", "[ucl]")
};
auto obj = map.find("42");
- REQUIRE(obj != std::nullopt);
- REQUIRE(*obj == 42);
+ REQUIRE(obj.value() == 42);
obj = map.find("43");
- REQUIRE(obj == std::nullopt);
+ REQUIRE(!obj.has_value());
}
TEST_CASE("ucl: map: iterate", "[ucl]")
@@ -179,12 +180,13 @@ TEST_CASE("ucl: map: pop", "[uc]")
REQUIRE(map.find("42") != std::nullopt);
auto obj = map.pop("42");
- REQUIRE(obj != std::nullopt);
- REQUIRE(*obj == 42);
+ REQUIRE(obj.value() == 42);
- REQUIRE(map.find("42") == std::nullopt);
+ REQUIRE(!map.find("42"));
REQUIRE(map["1"] == 1);
obj = map.pop("42");
- REQUIRE(obj == std::nullopt);
+ REQUIRE(!obj);
}
+
+//NOLINTEND(bugprone-unchecked-optional-access)