(pos, tests)
| 813 | return locator; |
| 814 | } |
| 815 | function determineTestTemplate(pos, tests) { |
| 816 | pos = pos > 0 ? pos - 1 : 0; |
| 817 | var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch; |
| 818 | for (var ndx = 0; ndx < tests.length; ndx++) { |
| 819 | var tst = tests[ndx]; |
| 820 | tstLocator = getLocator(tst, targetLocator.length); |
| 821 | var distance = Math.abs(tstLocator - targetLocator); |
| 822 | if (closest === undefined || tstLocator !== "" && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && bestMatch.match.newBlockMarker === "master" && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) { |
| 823 | closest = distance; |
| 824 | bestMatch = tst; |
| 825 | } |
| 826 | } |
| 827 | return bestMatch; |
| 828 | } |
| 829 | function getTestTemplate(pos, ndxIntlzr, tstPs) { |
| 830 | return getMaskSet().validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs)); |
| 831 | } |
no test coverage detected