-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Utilize ShellName and Add Test to Enable Completions W/out Shell on Unix #48918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
4a8787a
fe30c29
01c4346
1be09ad
24c85f9
bec48e2
5f14e1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| #nullable disable | ||
|
|
||
|
|
||
| using System.CommandLine.StaticCompletions.Shells; | ||
| using Microsoft.DotNet.Cli.Commands.BuildServer.Shutdown; | ||
| using Xunit; | ||
| using Xunit.Abstractions; | ||
nagilson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| using Parser = Microsoft.DotNet.Cli.Parser; | ||
|
|
||
| namespace System.CommandLine.StaticCompletions.Tests; | ||
|
|
||
| public class ShellDiscoveryTests() | ||
nagilson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| [Fact] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe parameterize this test with the shell names and set the SHELL env var before each run so we can easily test all of our shell experiences?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a great point -- I think this test should be ok since it works in general on any generic shell. If we had more capacity I would probably add this to the test, but not going to prioritize it right now. Thank you for reviewing |
||
| public void StaticCompletionsCanParseWithoutAShell() | ||
| { | ||
| var result = Parser.Instance.Parse(@"dotnet completions script"); | ||
| result.Errors.Should().BeEmpty(); | ||
| result.GetValue<IShellProvider>("@CompletionsCommand_ShellArgument_Description").Should().NotBeNull(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The using statement for
Microsoft.DotNet.Cli.Commands.BuildServer.Shutdownappears unused in this test class. Unused using directives should be removed.