From bde0bde066c2c693c92ab1046026c38a6c786d8d Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Mon, 22 Mar 2021 23:36:17 +0100 Subject: [PATCH] tests/utils: Add tests for startsWith --- tests/zm_utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/zm_utils.cpp b/tests/zm_utils.cpp index 5c7220f8d..f239cc304 100644 --- a/tests/zm_utils.cpp +++ b/tests/zm_utils.cpp @@ -63,3 +63,11 @@ TEST_CASE("replaceAll") { REQUIRE(replaceAll("aTOKENa", "TOKEN", "VAL") == "aVALa"); REQUIRE(replaceAll("aTOKENaTOKEN", "TOKEN", "VAL") == "aVALaVAL"); } + +TEST_CASE("startsWith") { + REQUIRE(startsWith("", "") == true); + + REQUIRE(startsWith("test", "test") == true); + REQUIRE(startsWith("test=abc", "test") == true); + REQUIRE(startsWith(" test=abc", "test") == false); +}