Skip to content

Commit 34563c5

Browse files
committed
add Complete_ReplKeywords_HaveDescriptions to test if replykeyword have intended description
1 parent 6d1d45c commit 34563c5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

CSharpRepl.Tests/CompletionTests.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,17 @@ public async Task Complete_ReplKeywords(string source, string item)
137137
var completion = completions.SingleOrDefault(c => c.DisplayText == item);
138138
Assert.NotNull(completion);
139139
}
140-
}
140+
141+
[Theory]
142+
[InlineData("he", "help", "Show help")]
143+
[InlineData("ex", "exit", "Exit the REPL")]
144+
[InlineData("cl", "clear", "Clear the terminal")]
145+
public async Task Complete_ReplKeywords_HaveDescription(string source, string item, string expectedDescriptionFragment)
146+
{
147+
var completions = await promptCallbacks.GetCompletionItemsCoreAsync(source, source.Length);
148+
var completion = completions.SingleOrDefault(c => c.DisplayText == item);
149+
Assert.NotNull(completion);
150+
var description = await completion.GetExtendedDescriptionAsync(default);
151+
Assert.Contains(expectedDescriptionFragment, description.Text);
152+
}
153+
}

0 commit comments

Comments
 (0)