diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-04 22:06:39 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-04 22:06:39 +0800 |
| commit | 8bea03e0811588e741050b598b8123865b333999 (patch) | |
| tree | dab70865e53fca11960cb899454d64db9e8ed98d /test/toml | |
| parent | 1a6111e3f02b0a9cff0f81fb524b4dfb7d69854b (diff) | |
| download | cru-8bea03e0811588e741050b598b8123865b333999.tar.gz cru-8bea03e0811588e741050b598b8123865b333999.tar.bz2 cru-8bea03e0811588e741050b598b8123865b333999.zip | |
Move toml to base.
Diffstat (limited to 'test/toml')
| -rw-r--r-- | test/toml/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | test/toml/ParserTest.cpp | 31 |
2 files changed, 0 insertions, 37 deletions
diff --git a/test/toml/CMakeLists.txt b/test/toml/CMakeLists.txt deleted file mode 100644 index a0909349..00000000 --- a/test/toml/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_executable(CruTomlTest - ParserTest.cpp -) -target_link_libraries(CruTomlTest PRIVATE CruToml CruTestBase) - -cru_catch_discover_tests(CruTomlTest) diff --git a/test/toml/ParserTest.cpp b/test/toml/ParserTest.cpp deleted file mode 100644 index 4a4ba212..00000000 --- a/test/toml/ParserTest.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "cru/toml/TomlDocument.h" -#include "cru/toml/TomlParser.h" - -#include <catch2/catch_test_macros.hpp> - -using namespace cru::toml; - -TEST_CASE("CruTomlParserTest Simple", "[toml]") { - TomlParser parser( - R"( -a1 = v1 -a2 = v2 -# comment - -[s1] -# comment -a3 = v3 -a4 = v4 - -[s2] -a5 = v5 -a6 = v6 - )"); - auto document = parser.Parse(); - REQUIRE(document.GetSection("")->GetValue("a1") == "v1"); - REQUIRE(document.GetSection("")->GetValue("a2") == "v2"); - REQUIRE(document.GetSection("s1")->GetValue("a3") == "v3"); - REQUIRE(document.GetSection("s1")->GetValue("a4") == "v4"); - REQUIRE(document.GetSection("s2")->GetValue("a5") == "v5"); - REQUIRE(document.GetSection("s2")->GetValue("a6") == "v6"); -} |
