diff options
author | crupest <crupest@outlook.com> | 2022-05-10 19:18:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-05-10 19:18:32 +0800 |
commit | 891bf38d8580b83cdf6ae315cb2650dae7d79006 (patch) | |
tree | 3e7714df65147489c88dfc00a656339b29097d90 /test/toml | |
parent | b846a16e42b30418fe91ba3f06771fad57100624 (diff) | |
download | cru-891bf38d8580b83cdf6ae315cb2650dae7d79006.tar.gz cru-891bf38d8580b83cdf6ae315cb2650dae7d79006.tar.bz2 cru-891bf38d8580b83cdf6ae315cb2650dae7d79006.zip |
...
Diffstat (limited to 'test/toml')
-rw-r--r-- | test/toml/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/toml/ParserTest.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/toml/CMakeLists.txt b/test/toml/CMakeLists.txt index 98270d30..c80355ed 100644 --- a/test/toml/CMakeLists.txt +++ b/test/toml/CMakeLists.txt @@ -10,4 +10,4 @@ if (WIN32) ) endif() -gtest_discover_tests(cru_toml_test) +catch_discover_tests(cru_toml_test) diff --git a/test/toml/ParserTest.cpp b/test/toml/ParserTest.cpp index 5e9b84b9..b35b932a 100644 --- a/test/toml/ParserTest.cpp +++ b/test/toml/ParserTest.cpp @@ -1,11 +1,11 @@ #include "cru/toml/TomlDocument.h" #include "cru/toml/TomlParser.h" -#include <gtest/gtest.h> +#include <catch2/catch_test_macros.hpp> using namespace cru::toml; -TEST(CruTomlParserTest, Simple) { +TEST_CASE("CruTomlParserTest Simple", "[toml]") { TomlParser parser( uR"( a1 = v1 @@ -22,10 +22,10 @@ a5 = v5 a6 = v6 )"); auto document = parser.Parse(); - ASSERT_EQ(document.GetSection(u"")->GetValue(u"a1"), u"v1"); - ASSERT_EQ(document.GetSection(u"")->GetValue(u"a2"), u"v2"); - ASSERT_EQ(document.GetSection(u"s1")->GetValue(u"a3"), u"v3"); - ASSERT_EQ(document.GetSection(u"s1")->GetValue(u"a4"), u"v4"); - ASSERT_EQ(document.GetSection(u"s2")->GetValue(u"a5"), u"v5"); - ASSERT_EQ(document.GetSection(u"s2")->GetValue(u"a6"), u"v6"); + REQUIRE(document.GetSection(u"")->GetValue(u"a1") == u"v1"); + REQUIRE(document.GetSection(u"")->GetValue(u"a2") == u"v2"); + REQUIRE(document.GetSection(u"s1")->GetValue(u"a3") == u"v3"); + REQUIRE(document.GetSection(u"s1")->GetValue(u"a4") == u"v4"); + REQUIRE(document.GetSection(u"s2")->GetValue(u"a5") == u"v5"); + REQUIRE(document.GetSection(u"s2")->GetValue(u"a6") == u"v6"); } |