mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Format
clang-format: 18.1.8 -> 19.1.7
(cherry picked from commit 55297f865c
)
# Conflicts:
# src/libstore-test-support/outputs-spec.cc
This commit is contained in:
parent
f33a435329
commit
5671175a5e
2 changed files with 32 additions and 4 deletions
|
@ -44,10 +44,11 @@ static void downloadToSink(
|
|||
|
||||
static std::string getLfsApiToken(const ParsedURL & url)
|
||||
{
|
||||
auto [status, output] = runProgram(RunOptions{
|
||||
.program = "ssh",
|
||||
.args = {*url.authority, "git-lfs-authenticate", url.path, "download"},
|
||||
});
|
||||
auto [status, output] = runProgram(
|
||||
RunOptions{
|
||||
.program = "ssh",
|
||||
.args = {*url.authority, "git-lfs-authenticate", url.path, "download"},
|
||||
});
|
||||
|
||||
if (output.empty())
|
||||
throw Error(
|
||||
|
|
27
src/libstore-test-support/outputs-spec.cc
Normal file
27
src/libstore-test-support/outputs-spec.cc
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "nix/tests/outputs-spec.hh"
|
||||
|
||||
#include <rapidcheck.h>
|
||||
|
||||
namespace rc {
|
||||
using namespace nix;
|
||||
|
||||
Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
|
||||
{
|
||||
return gen::mapcat(
|
||||
gen::inRange<uint8_t>(0, std::variant_size_v<OutputsSpec::Raw>), [](uint8_t n) -> Gen<OutputsSpec> {
|
||||
switch (n) {
|
||||
case 0:
|
||||
return gen::just((OutputsSpec) OutputsSpec::All{});
|
||||
case 1:
|
||||
return gen::map(
|
||||
gen::nonEmpty(
|
||||
gen::container<StringSet>(
|
||||
gen::map(gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))),
|
||||
[](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; });
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue