Fix failing Cache tests
This commit is contained in:
parent
03544ad0cd
commit
bbc23af138
3 changed files with 8 additions and 8 deletions
|
@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Cli
|
|||
{
|
||||
public static Command Cache() =>
|
||||
Create.Command(
|
||||
LocalizableStrings.AppFullName,
|
||||
"cache",
|
||||
LocalizableStrings.AppDescription,
|
||||
Accept.ZeroOrMoreArguments,
|
||||
CommonOptions.HelpOption(),
|
||||
|
@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli
|
|||
.With(name: LocalizableStrings.OutputOption)
|
||||
.ForwardAs(o => $"/p:ComposeDir={o.Arguments.Single()}")),
|
||||
Create.Option(
|
||||
"-w |--working-dir",
|
||||
"-w|--working-dir",
|
||||
LocalizableStrings.IntermediateWorkingDirOptionDescription,
|
||||
Accept.ExactlyOneArgument
|
||||
.With(name: LocalizableStrings.IntermediateWorkingDirOption)
|
||||
|
|
|
@ -36,11 +36,11 @@ namespace Microsoft.DotNet.Tools.Cache
|
|||
|
||||
var appliedBuildOptions = result["dotnet"]["cache"];
|
||||
|
||||
if (!result.HasOption("-e"))
|
||||
if (!appliedBuildOptions.HasOption("-e"))
|
||||
{
|
||||
throw new InvalidOperationException(LocalizableStrings.SpecifyEntries);
|
||||
}
|
||||
|
||||
|
||||
msbuildArgs.Add("/t:ComposeCache");
|
||||
|
||||
msbuildArgs.AddRange(appliedBuildOptions.OptionValuesToBeForwarded());
|
||||
|
|
|
@ -27,10 +27,10 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { "-f", "<framework>" }, @"/p:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "--framework", "<framework>" }, @"/p:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "-r", "<runtime>" }, @"/p:RuntimeIdentifier=<runtime>")]
|
||||
[InlineData(new string[] { "--runtime", "<runtime>" }, @"/p:RuntimeIdentifier=<runtime>")]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, @"/p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, @"/p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, @"/p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, @"/p:RuntimeIdentifier=<rid>")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
{
|
||||
args = ArgsPrefix.Concat(args).ToArray();
|
||||
|
|
Loading…
Add table
Reference in a new issue