Commit 258a6198 authored by Jacob Bogdanov's avatar Jacob Bogdanov

Fix backwards assertions

parent 3b02ff3b
......@@ -821,10 +821,10 @@ TEST(headers_test, raw_headers_are_case_insensitive)
step.apply(cursor);
// or the header you try and get, it should work:
ASSERT_FALSE(request.headers().tryGetRaw("Custom-Header").has_value());
ASSERT_FALSE(request.headers().tryGetRaw("CUSTOM-HEADER").has_value());
ASSERT_FALSE(request.headers().tryGetRaw("custom-header").has_value());
ASSERT_FALSE(request.headers().tryGetRaw("CuStOm-HeAdEr").has_value());
ASSERT_TRUE(request.headers().tryGetRaw("Custom-Header").has_value());
ASSERT_TRUE(request.headers().tryGetRaw("CUSTOM-HEADER").has_value());
ASSERT_TRUE(request.headers().tryGetRaw("custom-header").has_value());
ASSERT_TRUE(request.headers().tryGetRaw("CuStOm-HeAdEr").has_value());
}
}
......
......@@ -21,7 +21,7 @@ TEST(mime_test, basic_test)
ASSERT_TRUE(m2.toString() == "application/xhtml+xml");
auto m3 = MIME(Text, Plain);
ASSERT_TRUE(m3.q().has_value());
ASSERT_FALSE(m3.q().has_value());
m3.setQuality(Q::fromFloat(0.7));
ASSERT_TRUE(m3.q().value_or(Q(0)) == Q(70));
......@@ -54,12 +54,12 @@ TEST(mime_test, valid_parsing_test)
{
parse("application/json", [](const MediaType& m1) {
ASSERT_TRUE(m1 == MIME(Application, Json));
ASSERT_TRUE(m1.q().has_value());
ASSERT_FALSE(m1.q().has_value());
});
parse("application/xhtml+xml", [](const MediaType& m2) {
ASSERT_TRUE(m2 == MediaType(Type::Application, Subtype::Xhtml, Suffix::Xml));
ASSERT_TRUE(m2.q().has_value());
ASSERT_FALSE(m2.q().has_value());
});
parse("application/json; q=0.3", [](const MediaType& m3) {
......@@ -108,7 +108,7 @@ TEST(mime_test, valid_parsing_test)
parse("text/html; charset=ISO-8859-4", [](const MediaType& m10) {
ASSERT_TRUE(m10 == MIME(Text, Html));
ASSERT_TRUE(m10.q().has_value());
ASSERT_FALSE(m10.q().has_value());
auto charset = m10.getParam("charset");
ASSERT_TRUE(charset.value_or("") == "ISO-8859-4");
});
......@@ -150,12 +150,12 @@ TEST(mime_test, should_parse_case_insensitive_issue_179)
{
parse("Application/Json", [](const Mime::MediaType& mime) {
ASSERT_TRUE(mime == MIME(Application, Json));
ASSERT_TRUE(mime.q().has_value());
ASSERT_FALSE(mime.q().has_value());
});
parse("aPpliCAtion/Xhtml+XML", [](const MediaType& mime) {
ASSERT_TRUE(mime == MediaType(Type::Application, Subtype::Xhtml, Suffix::Xml));
ASSERT_TRUE(mime.q().has_value());
ASSERT_FALSE(mime.q().has_value());
});
parse("Application/Xhtml+XML; q=0.78", [](const MediaType& mime) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment