forked from TartanLlama/expected
Add test for issue 23
This commit is contained in:
@@ -143,7 +143,6 @@ matrix:
|
|||||||
packages:
|
packages:
|
||||||
- g++-5
|
- g++-5
|
||||||
env: COMPILER=g++-5 CXXSTD=14
|
env: COMPILER=g++-5 CXXSTD=14
|
||||||
|
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
@@ -26,6 +26,15 @@ TEST_CASE("Issue 17", "[issues.17]") {
|
|||||||
struct a {};
|
struct a {};
|
||||||
struct b : a {};
|
struct b : a {};
|
||||||
|
|
||||||
|
auto doit() -> tl::expected<std::unique_ptr<b>, int> {
|
||||||
|
return tl::make_unexpected(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Issue 23", "[issues.23]") {
|
||||||
|
tl::expected<std::unique_ptr<a>, int> msg = doit();
|
||||||
|
REQUIRE(!msg.has_value());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("Issue 26", "[issues.26]") {
|
TEST_CASE("Issue 26", "[issues.26]") {
|
||||||
tl::expected<a, int> exp = tl::expected<b, int>(tl::unexpect, 0);
|
tl::expected<a, int> exp = tl::expected<b, int>(tl::unexpect, 0);
|
||||||
REQUIRE(!exp.has_value());
|
REQUIRE(!exp.has_value());
|
||||||
|
Reference in New Issue
Block a user