25#include <catch2/catch.hpp>
31TEST_CASE(
"nawa::utils functions",
"[unit][utils]") {
33 SECTION(
"Time conversions") {
34 time_t currentTime = time(
nullptr);
37 CHECK(smtpTime1 == 1573140590);
40 CHECK(httpTime1 == currentTime);
43 CHECK(smtpTime2 == currentTime);
48 SECTION(
"Path splitting") {
49 string t1 =
"p1/p2/p3";
50 string t2 =
"/p1/p2/p3";
51 string t3 =
"/p1/p2/p3/";
52 string t4 =
"/p1/p2/p3?test=/xyz";
53 string t5 =
"/p1/p2/p3/?test=/xyz/";
Exception class that can be used by apps to catch errors resulting from nawa function calls.
std::vector< std::string > splitPath(std::string const &pathString)
std::string makeHttpTime(time_t time)
time_t readSmtpTime(std::string const &smtpTime)
time_t readHttpTime(std::string const &httpTime)
std::string makeSmtpTime(time_t time)
TEST_CASE("nawa::utils functions", "[unit][utils]")
Contains useful functions that improve the readability and facilitate maintenance of the NAWA code.