Implement not.greaterThan for completion list

This commit is contained in:
Ryan Cavanaugh 2015-10-08 15:31:59 -07:00
parent b1c8303300
commit 1e708b46a7
2 changed files with 11 additions and 4 deletions

View file

@ -588,14 +588,21 @@ namespace FourSlash {
}
}
public verifyCompletionListItemsCountIsGreaterThan(count: number) {
public verifyCompletionListItemsCountIsGreaterThan(count: number, negative: boolean) {
this.taoInvalidReason = "verifyCompletionListItemsCountIsGreaterThan NYI";
let completions = this.getCompletionListAtCaret();
let itemsCount = completions.entries.length;
if (itemsCount <= count) {
this.raiseError(`Expected completion list items count to be greater than ${count}, but is actually ${itemsCount}`);
if (negative) {
if (itemsCount > count) {
this.raiseError(`Expected completion list items count to not be greater than ${count}, but is actually ${itemsCount}`);
}
}
else {
if (itemsCount <= count) {
this.raiseError(`Expected completion list items count to be greater than ${count}, but is actually ${itemsCount}`);
}
}
}

View file

@ -205,7 +205,7 @@ module FourSlashInterface {
// Verifies the completion list items count to be greater than the specified amount. The
// completion list is brought up if necessary
public completionListItemsCountIsGreaterThan(count: number) {
FourSlash.currentTestState.verifyCompletionListItemsCountIsGreaterThan(count);
FourSlash.currentTestState.verifyCompletionListItemsCountIsGreaterThan(count, this.negative);
}
public completionListIsEmpty() {