Fix occurance
typo.
This commit is contained in:
parent
6dce7ce545
commit
67d986af43
1 changed files with 10 additions and 10 deletions
|
@ -2122,31 +2122,31 @@ module FourSlash {
|
||||||
public verifyOccurrencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) {
|
public verifyOccurrencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) {
|
||||||
this.taoInvalidReason = 'verifyOccurrencesAtPositionListContains NYI';
|
this.taoInvalidReason = 'verifyOccurrencesAtPositionListContains NYI';
|
||||||
|
|
||||||
let occurances = this.getOccurancesAtCurrentPosition();
|
let occurrences = this.getOccurancesAtCurrentPosition();
|
||||||
|
|
||||||
if (!occurances || occurances.length === 0) {
|
if (!occurrences || occurrences.length === 0) {
|
||||||
this.raiseError('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.');
|
this.raiseError('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < occurances.length; i++) {
|
for (let i = 0; i < occurrences.length; i++) {
|
||||||
let occurance = occurances[i];
|
let occurrence = occurrences[i];
|
||||||
if (occurance && occurance.fileName === fileName && occurance.textSpan.start === start && ts.textSpanEnd(occurance.textSpan) === end) {
|
if (occurrence && occurrence.fileName === fileName && occurrence.textSpan.start === start && ts.textSpanEnd(occurrence.textSpan) === end) {
|
||||||
if (typeof isWriteAccess !== "undefined" && occurance.isWriteAccess !== isWriteAccess) {
|
if (typeof isWriteAccess !== "undefined" && occurrence.isWriteAccess !== isWriteAccess) {
|
||||||
this.raiseError('verifyOccurancesAtPositionListContains failed - item isWriteAccess value does not match, actual: ' + occurance.isWriteAccess + ', expected: ' + isWriteAccess + '.');
|
this.raiseError('verifyOccurrencesAtPositionListContains failed - item isWriteAccess value does not match, actual: ' + occurrence.isWriteAccess + ', expected: ' + isWriteAccess + '.');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let missingItem = { fileName: fileName, start: start, end: end, isWriteAccess: isWriteAccess };
|
let missingItem = { fileName: fileName, start: start, end: end, isWriteAccess: isWriteAccess };
|
||||||
this.raiseError('verifyOccurancesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(occurances) + ')');
|
this.raiseError('verifyOccurrencesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(occurrences) + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
public verifyOccurrencesAtPositionListCount(expectedCount: number) {
|
public verifyOccurrencesAtPositionListCount(expectedCount: number) {
|
||||||
this.taoInvalidReason = 'verifyOccurrencesAtPositionListCount NYI';
|
this.taoInvalidReason = 'verifyOccurrencesAtPositionListCount NYI';
|
||||||
|
|
||||||
let occurances = this.getOccurancesAtCurrentPosition();
|
let occurrences = this.getOccurancesAtCurrentPosition();
|
||||||
let actualCount = occurances ? occurances.length : 0;
|
let actualCount = occurrences ? occurrences.length : 0;
|
||||||
if (expectedCount !== actualCount) {
|
if (expectedCount !== actualCount) {
|
||||||
this.raiseError('verifyOccurrencesAtPositionListCount failed - actual: ' + actualCount + ', expected:' + expectedCount);
|
this.raiseError('verifyOccurrencesAtPositionListCount failed - actual: ' + actualCount + ', expected:' + expectedCount);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue