From 1e708b46a7251ea9a8b6b4b8c5c1d925e098fed6 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 8 Oct 2015 15:31:59 -0700 Subject: [PATCH] Implement not.greaterThan for completion list --- src/harness/fourslash.ts | 13 ++++++++++--- tests/cases/fourslash/fourslash.ts | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index a846077a85f..2b6f6ee8d0e 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -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}`); + } } } diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 42cfc1248b0..8d1ee35dc1a 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -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() {