summaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/test.cc b/test.cc
index 299a93b..6ce453f 100644
--- a/test.cc
+++ b/test.cc
@@ -198,13 +198,15 @@ int main() {
::std::cout <<"zp " <<::zp::ver.api <<"." <<::zp::ver.ext <<", run-time test\n";
try {
-#if false
[&] {
- tst("optionals");
+ tst("results");
- ::zp::opt<::zp::i8s> opt = ::zp::nulopt;
+ ::zp::res<::zp::i8s,::zp::i8s> res = ::zp::err<::zp::i8s>(0x45);
- cmp(opt.chk(),false);
+ cmp(res.chk(),false);
+ cmp(res.err(),0x45);
+
+ res = -0x45;
auto const fun = [](char const* msg) -> void {
::std::cout << msg << ::std::endl;
@@ -212,12 +214,9 @@ int main() {
::std::abort();
};
- opt = -0x45;
-
- cmp(opt.chk(),true);
- cmp(opt.exp(fun,"expectation failed"),-0x45);
+ cmp(res.chk(),true);
+ cmp(res.exp(fun,"expectation failed"),-0x45);
}();
-#endif
[&] {
tst("special numbers");