From 2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 17:07:04 +0100 Subject: add nihil.std --- nihil.config/tests/CMakeLists.txt | 13 ------------- nihil.config/tests/string.cc | 36 ------------------------------------ 2 files changed, 49 deletions(-) delete mode 100644 nihil.config/tests/CMakeLists.txt delete mode 100644 nihil.config/tests/string.cc (limited to 'nihil.config/tests') diff --git a/nihil.config/tests/CMakeLists.txt b/nihil.config/tests/CMakeLists.txt deleted file mode 100644 index ffa60c3..0000000 --- a/nihil.config/tests/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This source code is released into the public domain. - -add_executable(nihil.config.test - string.cc -) - -target_link_libraries(nihil.config.test PRIVATE - nihil.config - Catch2::Catch2WithMain) - -include(CTest) -include(Catch) -catch_discover_tests(nihil.config.test) diff --git a/nihil.config/tests/string.cc b/nihil.config/tests/string.cc deleted file mode 100644 index aeb1ef8..0000000 --- a/nihil.config/tests/string.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This source code is released into the public domain. - */ - -#include - -#include - -import nihil.config; - -TEST_CASE("nihil.config: string option", "[nihil][nihil.config]") -{ - std::string storage; - - auto opt = nihil::config::get_option("test_option"); - REQUIRE(!opt); - - { - auto string_option = nihil::config::string( - storage, "test_option", "This is a test option"); - - auto opt = nihil::config::get_option("test_option"); - REQUIRE(opt); - - REQUIRE((*opt)->name() == "test_option"); - REQUIRE((*opt)->description() == "This is a test option"); - REQUIRE((*opt)->is_default() == true); - REQUIRE((*opt)->string() == ""); - - REQUIRE((*opt)->string("testing")); - REQUIRE(storage == "testing"); - } - - opt = nihil::config::get_option("test_option"); - REQUIRE(!opt); -} -- cgit v1.2.3