blob: 5fddc5785b998362880a858763de50894bb0ca4d [file] [log] [blame]
#include "http_utility.hpp"
#include <gtest/gtest.h>
TEST(HttpUtility, requestPrefersHtml)
{
EXPECT_FALSE(
http_helpers::requestPrefersHtml("*/*, application/octet-stream"));
EXPECT_TRUE(http_helpers::isOctetAccepted("*/*, application/octet-stream"));
EXPECT_TRUE(
http_helpers::requestPrefersHtml("text/html, application/json"));
EXPECT_FALSE(http_helpers::isOctetAccepted("text/html, application/json"));
EXPECT_FALSE(http_helpers::requestPrefersHtml("application/json"));
EXPECT_FALSE(http_helpers::isOctetAccepted("application/json"));
}