-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathClassify.cpp
More file actions
31 lines (25 loc) · 759 Bytes
/
Classify.cpp
File metadata and controls
31 lines (25 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "rapidcheck/Classify.h"
#include "rapidcheck/detail/ImplicitParam.h"
#include "rapidcheck/detail/PropertyContext.h"
namespace rc {
namespace detail {
void tag(std::initializer_list<Stringified> tags) {
const auto handler = ImplicitParam<param::CurrentPropertyContext>::value();
for (const auto &tag : tags) {
handler->addTag(tag.str);
}
}
void classify(std::string condition, std::initializer_list<Stringified> tags) {
const auto handler = ImplicitParam<param::CurrentPropertyContext>::value();
if (tags.size() == 0) {
if (!condition.empty()) {
handler->addTag(std::move(condition));
}
} else {
for (const auto &tag : tags) {
handler->addTag(tag.str);
}
}
}
} // namespace detail
} // namespace rc