summaryrefslogtreecommitdiffhomepage
path: root/test/option.test.cpp
blob: 1869d24bff031eb0d4c26f65efef1ecda6ede94e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2025, 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-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(""));
}