|
|
@ -52,6 +52,8 @@ const testInput: TestInputFunction = ({ |
|
|
|
compare: dCompare = null, |
|
|
|
compare: dCompare = null, |
|
|
|
displayMax: dDisplayMax, |
|
|
|
displayMax: dDisplayMax, |
|
|
|
displayMin: dDisplayMin, |
|
|
|
displayMin: dDisplayMin, |
|
|
|
|
|
|
|
getCompare: dGetCompare, |
|
|
|
|
|
|
|
getValue: dGetValue, |
|
|
|
max: dMax = 0, |
|
|
|
max: dMax = 0, |
|
|
|
min: dMin = 0, |
|
|
|
min: dMin = 0, |
|
|
|
onSuccess: dOnSuccess, |
|
|
|
onSuccess: dOnSuccess, |
|
|
@ -62,10 +64,12 @@ const testInput: TestInputFunction = ({ |
|
|
|
tests: requiredTests, |
|
|
|
tests: requiredTests, |
|
|
|
} = tests[id]; |
|
|
|
} = tests[id]; |
|
|
|
const { |
|
|
|
const { |
|
|
|
compare = dCompare, |
|
|
|
getCompare = dGetCompare, |
|
|
|
|
|
|
|
getValue = dGetValue, |
|
|
|
max = dMax, |
|
|
|
max = dMax, |
|
|
|
min = dMin, |
|
|
|
min = dMin, |
|
|
|
value = dValue, |
|
|
|
compare = getCompare?.call(null) ?? dCompare, |
|
|
|
|
|
|
|
value = getValue?.call(null) ?? dValue, |
|
|
|
displayMax = dDisplayMax || String(max), |
|
|
|
displayMax = dDisplayMax || String(max), |
|
|
|
displayMin = dDisplayMin || String(min), |
|
|
|
displayMin = dDisplayMin || String(min), |
|
|
|
} = testsToRun[id]; |
|
|
|
} = testsToRun[id]; |
|
|
@ -77,7 +81,12 @@ const testInput: TestInputFunction = ({ |
|
|
|
onSuccess = dOnSuccess, |
|
|
|
onSuccess = dOnSuccess, |
|
|
|
test, |
|
|
|
test, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const singleResult: boolean = test({ compare, max, min, value }); |
|
|
|
const singleResult: boolean = test({ |
|
|
|
|
|
|
|
compare, |
|
|
|
|
|
|
|
max, |
|
|
|
|
|
|
|
min, |
|
|
|
|
|
|
|
value, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const { cbFailure, cbSuccess } = setSingleCallback({ |
|
|
|
const { cbFailure, cbSuccess } = setSingleCallback({ |
|
|
|
onFailure, |
|
|
|
onFailure, |
|
|
@ -89,7 +98,14 @@ const testInput: TestInputFunction = ({ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
allResult = singleResult; |
|
|
|
allResult = singleResult; |
|
|
|
|
|
|
|
|
|
|
|
cbFailure?.call(null, { displayMax, displayMin, max, min, value }); |
|
|
|
cbFailure?.call(null, { |
|
|
|
|
|
|
|
compare, |
|
|
|
|
|
|
|
displayMax, |
|
|
|
|
|
|
|
displayMin, |
|
|
|
|
|
|
|
max, |
|
|
|
|
|
|
|
min, |
|
|
|
|
|
|
|
value, |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return singleResult; |
|
|
|
return singleResult; |
|
|
|