From: Remi Gacogne Date: Mon, 20 Nov 2023 14:24:44 +0000 (+0100) Subject: Add more edge-case tests for `cleanSlashes()` (from Otto) X-Git-Tag: rec-5.0.0-rc1~28^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13513%2Fhead;p=thirdparty%2Fpdns.git Add more edge-case tests for `cleanSlashes()` (from Otto) Co-authored-by: Otto Moerbeek --- diff --git a/pdns/test-misc_hh.cc b/pdns/test-misc_hh.cc index 6e5662b19e..b3f0b3a4c2 100644 --- a/pdns/test-misc_hh.cc +++ b/pdns/test-misc_hh.cc @@ -403,6 +403,9 @@ BOOST_AUTO_TEST_CASE(test_CleanSlashes) { cleanSlashes(fullStr); return fullStr; }; + BOOST_CHECK_EQUAL(cleanSlashesWrapper(""), ""); + BOOST_CHECK_EQUAL(cleanSlashesWrapper("/"), "/"); + BOOST_CHECK_EQUAL(cleanSlashesWrapper("//"), "/"); BOOST_CHECK_EQUAL(cleanSlashesWrapper("/test"), "/test"); BOOST_CHECK_EQUAL(cleanSlashesWrapper("//test"), "/test"); BOOST_CHECK_EQUAL(cleanSlashesWrapper("///test"), "/test");