feat add expected
All checks were successful
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 1m19s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 1m32s
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m39s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 1m40s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 1m54s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m24s
All checks were successful
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 1m19s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 1m32s
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m39s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 1m40s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 1m54s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m24s
This commit is contained in:
parent
e9a9a2ff72
commit
f2408b4aec
@ -193,6 +193,7 @@ if(SLED_BUILD_TESTS)
|
||||
sled_add_test(NAME sled_rpc_test SRCS src/sled/network/rpc_test.cc)
|
||||
sled_add_test(NAME sled_string_view_test SRCS
|
||||
src/sled/nonstd/string_view_test.cc)
|
||||
sled_add_test(NAME sled_expected_test SRCS src/sled/nonstd/expected_test.cc)
|
||||
endif(SLED_BUILD_TESTS)
|
||||
|
||||
if(SLED_BUILD_FUZZ)
|
||||
|
2613
src/sled/nonstd/expected.h
Normal file
2613
src/sled/nonstd/expected.h
Normal file
File diff suppressed because it is too large
Load Diff
19
src/sled/nonstd/expected_test.cc
Normal file
19
src/sled/nonstd/expected_test.cc
Normal file
@ -0,0 +1,19 @@
|
||||
#include <sled/nonstd/expected.h>
|
||||
#include <sled/status.h>
|
||||
|
||||
TEST_SUITE("expected")
|
||||
{
|
||||
TEST_CASE("base")
|
||||
{
|
||||
sled::expected<int, int> e = 21;
|
||||
auto ret = e.map([](int v) { return v * 2; });
|
||||
CHECK(ret);
|
||||
CHECK_EQ(*ret, 42);
|
||||
}
|
||||
|
||||
TEST_CASE("unexpect")
|
||||
{
|
||||
sled::expected<int, int> e{sled::unexpect, 0};
|
||||
CHECK_EQ(e.error(), 0);
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@
|
||||
#include "inja.hpp"
|
||||
#include "rx.h"
|
||||
#include "sled/async/async.h"
|
||||
#include "sled/nonstd/expected.h"
|
||||
#include "sled/nonstd/string_view.h"
|
||||
#include "toml.hpp"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user