halcheck
1.0
Loading...
Searching...
No Matches
include
halcheck
test
config.hpp
1
#ifndef HALCHECK_TEST_CONFIG_HPP
2
#define HALCHECK_TEST_CONFIG_HPP
3
4
#include <halcheck/lib/string.hpp>
5
#include <halcheck/lib/type_traits.hpp>
6
#include <halcheck/test/strategy.hpp>
7
8
#include <
initializer_list
>
9
#include <
string
>
10
#include <
type_traits
>
11
#include <
utility
>
12
13
namespace
halcheck {
namespace
test {
14
15
struct
set {
16
template
<
typename
T>
17
set(
std::string
key,
const
T &value,
bool
weak =
false
)
18
: key(
std
::move(key)), value(lib::
to_string
(value)), weak(weak) {}
19
20
std::string
key;
21
std::string
value;
22
bool
weak;
23
};
24
25
test::strategy config(
const
std::initializer_list<test::set>
&);
26
27
template
<
typename
... Args,
HALCHECK_REQUIRE
(lib::conjunction<
std::is_convertible<Args, test::set>
...>())>
28
test::strategy config(Args &&...args) {
29
return
test::config({test::set(
std::forward<Args>
(args))...});
30
}
31
32
}}
// namespace halcheck::test
33
34
#endif
std::string
std::forward
T forward(T... args)
HALCHECK_REQUIRE
#define HALCHECK_REQUIRE(...)
Expands to a template argument that is only valid if the given argument evaluates to true.
Definition
type_traits.hpp:24
initializer_list
std::is_convertible
std
STL namespace.
string
std::to_string
T to_string(T... args)
type_traits
utility
Generated by
1.12.0