mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PTRun][Calculator]Update Mages to 2.0.1 (#19087)
* [PTRun][Calculator]Update Mages to 2.0.1 * Fix tests for the new precision
This commit is contained in:
@@ -97,8 +97,6 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
|||||||
private static IEnumerable<object[]> Interpret_QuirkOutput_WhenCalled_Data =>
|
private static IEnumerable<object[]> Interpret_QuirkOutput_WhenCalled_Data =>
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new object[] { "0.100000000000000000000", 0.00776627963145224M }, // BUG: Because data structure
|
|
||||||
new object[] { "0.200000000000000000000000", 0.000000400752841041379M }, // BUG: Because data structure
|
|
||||||
new object[] { "123 456", 56088M }, // BUG: Framework accepts ' ' as multiplication
|
new object[] { "123 456", 56088M }, // BUG: Framework accepts ' ' as multiplication
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -118,6 +116,29 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
|||||||
Assert.AreEqual(expectedResult, result.Result);
|
Assert.AreEqual(expectedResult, result.Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<object[]> Interpret_GreaterPrecision_WhenCalled_Data =>
|
||||||
|
new[]
|
||||||
|
{
|
||||||
|
new object[] { "0.100000000000000000000", 0.1M },
|
||||||
|
new object[] { "0.200000000000000000000000", 0.2M },
|
||||||
|
};
|
||||||
|
|
||||||
|
[DynamicData(nameof(Interpret_GreaterPrecision_WhenCalled_Data))]
|
||||||
|
[DataTestMethod]
|
||||||
|
public void Interpret_GreaterPrecision_WhenCalled(string input, decimal expectedResult)
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var engine = new CalculateEngine();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
// Using InvariantCulture since this is internal
|
||||||
|
var result = engine.Interpret(input, CultureInfo.InvariantCulture, out _);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.IsNotNull(result);
|
||||||
|
Assert.AreEqual(expectedResult, result.Result);
|
||||||
|
}
|
||||||
|
|
||||||
private static IEnumerable<object[]> Interpret_DifferentCulture_WhenCalled_Data =>
|
private static IEnumerable<object[]> Interpret_DifferentCulture_WhenCalled_Data =>
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
|
||||||
<PackageReference Include="Mages" Version="2.0.0" />
|
<PackageReference Include="Mages" Version="2.0.1" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
|
||||||
<PackageReference Include="Mages" Version="2.0.0" />
|
<PackageReference Include="Mages" Version="2.0.1" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
Reference in New Issue
Block a user