summaryrefslogtreecommitdiffhomepage
path: root/test/standard_tests/option.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/standard_tests/option.test.cpp')
-rw-r--r--test/standard_tests/option.test.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/standard_tests/option.test.cpp b/test/standard_tests/option.test.cpp
new file mode 100644
index 0000000..18e8cbb
--- /dev/null
+++ b/test/standard_tests/option.test.cpp
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: BSL-1.0
+// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// Official repository: https://github.com/ocl-foss-org/core
+
+/// @brief Checks if the test fails with the expected value.
+/// @author Amlal El Mahrouss
+
+#include <ocl/option.hpp>
+
+#define BOOST_TEST_MODULE option
+#include <boost/test/included/unit_test.hpp>
+
+BOOST_AUTO_TEST_CASE(option_should_fail)
+{
+ ocl::option opt(ocl::eval_false());
+ BOOST_CHECK_THROW(opt.expect(""), std::exception);
+}
+
+BOOST_AUTO_TEST_CASE(option_should_succeed)
+{
+ ocl::option opt(ocl::eval_true());
+ BOOST_CHECK_NO_THROW(opt.expect(""));
+}