summaryrefslogtreecommitdiff
path: root/test/TestUriUtil.cxx
blob: 17a6189e9dca8dd17203a2d56db994419e147c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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/"));
}