Move JSON helpers to lib

This commit is contained in:
WarmUpTill
2025-04-17 11:51:00 +02:00
committed by WarmUpTill
parent 7c4c0056ce
commit 5568f92ad0
13 changed files with 64 additions and 58 deletions

View File

@@ -20,21 +20,6 @@ TEST_CASE("ReplaceAll", "[utility]")
REQUIRE(input == "sleeping");
}
TEST_CASE("GetJsonField", "[utility]")
{
auto result = advss::GetJsonField("{}", "");
REQUIRE_FALSE(result);
result = advss::GetJsonField("{}", "not there");
REQUIRE_FALSE(result);
result = advss::GetJsonField("invalid json", "not there");
REQUIRE_FALSE(result);
result = advss::GetJsonField("{ \"test\": 1 }", "test");
REQUIRE(*result == "1");
}
TEST_CASE("CompareIgnoringLineEnding", "[utility]")
{
QString s1;