1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 02:01:48 +02:00

Allow unit test infra to be reused across libs' tests

This allows using Arbitrary "instances" defined in libstore-tests in
libexpr-tests, something we will leverage in a moment.
This commit is contained in:
John Ericson 2023-01-29 12:37:32 -05:00
parent 6772e9ed0a
commit ec0c0efec6
13 changed files with 50 additions and 21 deletions

View file

@ -7,7 +7,8 @@
#include "path-regex.hh"
#include "store-api.hh"
#include "libstoretests.hh"
#include "tests/libstore.hh"
#include "tests/path.hh"
namespace nix {
@ -73,11 +74,6 @@ void showValue(const StorePath & p, std::ostream & os) {
namespace rc {
using namespace nix;
template<>
struct Arbitrary<StorePath> {
static Gen<StorePath> arbitrary();
};
Gen<StorePath> Arbitrary<StorePath>::arbitrary()
{
auto len = *gen::inRange<size_t>(1, StorePath::MaxPathLen);