diff options
Diffstat (limited to 'test.cc')
-rw-r--r-- | test.cc | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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"); |