There is a pull request [1] addressing these upstream--it doesn't appear likely to be merged anytime soon though... this is a no-op til we enable -Wdeprecated-declarations, but helps in the direction of #744 [1]: https://github.com/emil-e/rapidcheck/pull/325 Change-Id: I27e2c7d81df152de8674696f2a56d5f21c414ce3
28 lines
721 B
C++
28 lines
721 B
C++
#include "tests/outputs-spec.hh"
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
#include <rapidcheck.h>
|
|
#pragma GCC diagnostic pop
|
|
|
|
namespace rc {
|
|
using namespace nix;
|
|
|
|
Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
|
|
{
|
|
switch (*gen::inRange<uint8_t>(0, std::variant_size_v<OutputsSpec::Raw>)) {
|
|
case 0:
|
|
return gen::just((OutputsSpec) OutputsSpec::All { });
|
|
case 1:
|
|
return gen::just((OutputsSpec) OutputsSpec::Names {
|
|
*gen::nonEmpty(gen::container<StringSet>(gen::map(
|
|
gen::arbitrary<StorePathName>(),
|
|
[](StorePathName n) { return n.name; }))),
|
|
});
|
|
default:
|
|
assert(false);
|
|
}
|
|
}
|
|
|
|
}
|