Fix equality test for expected<void,E>

This commit is contained in:
Sy Brand
2022-11-24 11:50:20 +00:00
parent 96d547c03d
commit d901f362cc
2 changed files with 26 additions and 1 deletions
+12 -1
View File
@@ -2,5 +2,16 @@
#include <tl/expected.hpp>
TEST_CASE("Relational operators", "[relops]") {
//TODO
tl::expected<int, int> o1 = 42;
tl::expected<int, int> o2{tl::unexpect, 0};
const tl::expected<int, int> o3 = 42;
REQUIRE(o1 == o1);
REQUIRE(o1 != o2);
REQUIRE(o1 == o3);
REQUIRE(o3 == o3);
tl::expected<void, int> o6;
REQUIRE(o6 == o6);
}