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