function testValidationWithPathRefs(expected, obj, vld, ...args) {
  const obj2 = args.reduce((acc, a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    if (argDef.refDepth >= 0) {
      const kind = argDef.type.name;
      if (!typeInfo[kind].acceptValidatorRef()) {
        acc[`_${i}`] = a;
      }
    }
    return acc;
  }, clone(obj));
  const pathArgs = args.map((a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    const kind = argDef.type.name;
    if (argDef.refDepth >= 0) {
      return typeInfo[kind].acceptValidatorRef() ? a : { $path: `_${i}` };
    }
    return a;
  });
  it(`${vld.info.name}(${pathArgs.map(a => JSON.stringify(a)).join(', ')}) should ${expected} for ${JSON.stringify(obj2)}`, () => {
    const vCreate = () => vld(...pathArgs);
    testValidationAssert(expected, vCreate, obj2);
  });
}
// All referenceable arguments are passed as $path references
All referenceable arguments are passed as $path references
All referenceable arguments are passed as $path references
function testValidationWithPathRefs(expected, obj, vld, ...args) {
  const obj2 = args.reduce((acc, a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    if (argDef.refDepth >= 0) {
      const kind = argDef.type.name;
      if (!typeInfo[kind].acceptValidatorRef()) {
        acc[`_${i}`] = a;
      }
    }
    return acc;
  }, clone(obj));
  const pathArgs = args.map((a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    const kind = argDef.type.name;
    if (argDef.refDepth >= 0) {
      return typeInfo[kind].acceptValidatorRef() ? a : { $path: `_${i}` };
    }
    return a;
  });
  it(`${vld.info.name}(${pathArgs.map(a => JSON.stringify(a)).join(', ')}) should ${expected} for ${JSON.stringify(obj2)}`, () => {
    const vCreate = () => vld(...pathArgs);
    testValidationAssert(expected, vCreate, obj2);
  });
}
function testValidationWithPathRefs ( expected , obj , vld , ... args ) { const obj2 = args . reduce ( ( acc , a , i ) => { const argDef = vld . info . argDescriptors [ vld . info . adjustArgDescriptorIndex ( i ) ] ; if ( argDef . refDepth >= 0 ) { const kind = argDef . type . name ; if ( ! typeInfo [ kind ] . acceptValidatorRef ( ) ) { acc [ ` ${ i } ` ] = a ; } } return acc ; } , clone ( obj ) ) ; const pathArgs = args . map ( ( a , i ) => { const argDef = vld . info . argDescriptors [ vld . info . adjustArgDescriptorIndex ( i ) ] ; const kind = argDef . type . name ; if ( argDef . refDepth >= 0 ) { return typeInfo [ kind ] . acceptValidatorRef ( ) ? a : { $path : ` ${ i } ` } ; } return a ; } ) ; it ( ` ${ vld . info . name } ${ pathArgs . map ( a => JSON . stringify ( a ) ) . join ( ', ' ) } ${ expected } ${ JSON . stringify ( obj2 ) } ` , ( ) => { const vCreate = ( ) => vld ( ... pathArgs ) ; testValidationAssert ( expected , vCreate , obj2 ) ; } ) ; }
All referenceable arguments are passed as $path references
All referenceable arguments are passed as $path references