File: links.cpp

package info (click to toggle)
newsboat 2.38-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,540 kB
  • sloc: cpp: 90,216; xml: 606; sh: 429; makefile: 369; ruby: 258; python: 239; ansic: 211; php: 63; awk: 59; perl: 38
file content (25 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "links.h"

#include "3rd-party/catch.hpp"

using namespace newsboat;

TEST_CASE("Each URL is unique", "[Links]")
{
	Links links;

	links.add_link("https://newsboat.org/news.atom", LinkType::HREF);
	links.add_link("https://newsboat.org/news.atom", LinkType::HREF);
	REQUIRE(links.size() == 1);
}

TEST_CASE("Password and username are censored", "[Links]")
{
	Links links;

	links.add_link("http://user:pass@somesite.com/feed", LinkType::HREF);
	REQUIRE(links.begin()->url == "http://*:*@somesite.com/feed");
	links.add_link("http://user:pass@somesite.com/feed", LinkType::HREF);
	REQUIRE(links.size() == 1);
}