function testValidationWithVarRefs(expected, obj, vld, ...args) {
  const scope = args.reduce((acc, a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    if (argDef.refDepth >= 0) {
      const kind = argDef.type.name;
      acc[`${typeInfo[kind].acceptValidatorRef() ? '$' : ''}v${i}`] = a;
    }
    return acc;
  }, {});
  const varArgs = args.map((a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    const kind = argDef.type.name;
    if (argDef.refDepth >= 0) {
      return { $var: `${typeInfo[kind].acceptValidatorRef() ? '$' : ''}v${i}` };
    }
    return a;
  });
  it(`${vld.info.name}(${varArgs.map(a => JSON.stringify(a)).join(', ')}) in scope ${JSON.stringify(scope)} should ${expected} for ${JSON.stringify(obj)}`, () => {
    const vCreate = () => V.def(scope, vld(...varArgs));
    testValidationAssert(expected, vCreate, obj);
  });
}
// All referenceable arguments are passed as $var references
All referenceable arguments are passed as $var references
All referenceable arguments are passed as $var references
function testValidationWithVarRefs(expected, obj, vld, ...args) {
  const scope = args.reduce((acc, a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    if (argDef.refDepth >= 0) {
      const kind = argDef.type.name;
      acc[`${typeInfo[kind].acceptValidatorRef() ? '$' : ''}v${i}`] = a;
    }
    return acc;
  }, {});
  const varArgs = args.map((a, i) => {
    const argDef = vld.info.argDescriptors[vld.info.adjustArgDescriptorIndex(i)];
    const kind = argDef.type.name;
    if (argDef.refDepth >= 0) {
      return { $var: `${typeInfo[kind].acceptValidatorRef() ? '$' : ''}v${i}` };
    }
    return a;
  });
  it(`${vld.info.name}(${varArgs.map(a => JSON.stringify(a)).join(', ')}) in scope ${JSON.stringify(scope)} should ${expected} for ${JSON.stringify(obj)}`, () => {
    const vCreate = () => V.def(scope, vld(...varArgs));
    testValidationAssert(expected, vCreate, obj);
  });
}
function testValidationWithVarRefs ( expected , obj , vld , ... args ) { const scope = args . reduce ( ( acc , a , i ) => { const argDef = vld . info . argDescriptors [ vld . info . adjustArgDescriptorIndex ( i ) ] ; if ( argDef . refDepth >= 0 ) { const kind = argDef . type . name ; acc [ ` ${ typeInfo [ kind ] . acceptValidatorRef ( ) ? '$' : '' } ${ i } ` ] = a ; } return acc ; } , { } ) ; const varArgs = args . map ( ( a , i ) => { const argDef = vld . info . argDescriptors [ vld . info . adjustArgDescriptorIndex ( i ) ] ; const kind = argDef . type . name ; if ( argDef . refDepth >= 0 ) { return { $var : ` ${ typeInfo [ kind ] . acceptValidatorRef ( ) ? '$' : '' } ${ i } ` } ; } return a ; } ) ; it ( ` ${ vld . info . name } ${ varArgs . map ( a => JSON . stringify ( a ) ) . join ( ', ' ) } ${ JSON . stringify ( scope ) } ${ expected } ${ JSON . stringify ( obj ) } ` , ( ) => { const vCreate = ( ) => V . def ( scope , vld ( ... varArgs ) ) ; testValidationAssert ( expected , vCreate , obj ) ; } ) ; }
All referenceable arguments are passed as $var references
All referenceable arguments are passed as $var references