Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 1, 2023
1 parent 9ef6007 commit 83f242e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import { VecCandidDefinition } from '../../definition_arb/types';
import { CandidValues, CandidValueArb } from '../../values';

export function VecValuesArb(
vecType: VecCandidDefinition
vecDefinition: VecCandidDefinition
): fc.Arbitrary<CandidValues<Vec>> {
const arbitraryMemberValues = fc
.tuple(fc.array(fc.constant(null)), fc.constant(vecType.innerType))
.tuple(
fc.array(fc.constant(null)),
fc.constant(vecDefinition.innerType)
)
.chain(([arrayTemplate, innerType]) =>
fc.tuple(...arrayTemplate.map(() => CandidValueArb(innerType)))
);

const innerCandidType = vecType.innerType.candidMeta.candidType;
const innerCandidType = vecDefinition.innerType.candidMeta.candidType;

return arbitraryMemberValues.map((fieldValues) => {
const valueLiteral = generateValueLiteral(fieldValues, innerCandidType);
Expand Down

0 comments on commit 83f242e

Please sign in to comment.