test/TestUtil: move to test/util/

This commit is contained in:
Max Kellermann
2020-12-02 15:01:21 +01:00
parent 618f94f589
commit 49e1ce7c43
11 changed files with 21 additions and 18 deletions

21
test/util/TestUriUtil.cxx Normal file
View File

@@ -0,0 +1,21 @@
/*
* Unit tests for src/util/
*/
#include "util/UriUtil.hxx"
#include <gtest/gtest.h>
TEST(UriUtil, RemoveAuth)
{
EXPECT_EQ(std::string(),
uri_remove_auth("http://www.example.com/"));
EXPECT_EQ(std::string("http://www.example.com/"),
uri_remove_auth("http://foo:bar@www.example.com/"));
EXPECT_EQ(std::string("http://www.example.com/"),
uri_remove_auth("http://foo@www.example.com/"));
EXPECT_EQ(std::string(),
uri_remove_auth("http://www.example.com/f:oo@bar"));
EXPECT_EQ(std::string("ftp://ftp.example.com/"),
uri_remove_auth("ftp://foo:bar@ftp.example.com/"));
}