aboutsummaryrefslogtreecommitdiff
path: root/test/ruststring.cpp
blob: 3b09c7b9568ed974a672accc130cb54f4db7e471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "ruststring.h"

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

using namespace newsboat;

extern "C" char* rs_get_string(const char* line);

TEST_CASE("RustString constructor and conversion to std::string",
	"[RustString]")
{
	RustString foo(rs_get_string("foo"));
	REQUIRE(std::string(foo) == std::string("foo"));

	RustString bar(nullptr);
	REQUIRE(std::string(bar) == std::string());
}