mirror of
https://github.com/TartanLlama/expected.git
synced 2025-08-03 19:04:29 +02:00
Add test for issue 23
This commit is contained in:
@@ -143,7 +143,6 @@ matrix:
|
||||
packages:
|
||||
- g++-5
|
||||
env: COMPILER=g++-5 CXXSTD=14
|
||||
|
||||
- compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
|
@@ -26,6 +26,15 @@ TEST_CASE("Issue 17", "[issues.17]") {
|
||||
struct 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]") {
|
||||
tl::expected<a, int> exp = tl::expected<b, int>(tl::unexpect, 0);
|
||||
REQUIRE(!exp.has_value());
|
||||
|
Reference in New Issue
Block a user