mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-31 06:25:20 +00:00
[PTRun][Calculator]Update mages to v3.0.0 and support for randi(n)
(#36560)
* update to mages 3.0.0 * allow randi() in calculator plugin * fix tests and input validation * fix spell check
This commit is contained in:
1
.github/actions/spell-check/expect.txt
vendored
1
.github/actions/spell-check/expect.txt
vendored
@@ -1213,6 +1213,7 @@ QUEUESYNC
|
|||||||
QUNS
|
QUNS
|
||||||
RAII
|
RAII
|
||||||
RAlt
|
RAlt
|
||||||
|
randi
|
||||||
Rasterize
|
Rasterize
|
||||||
RAWINPUTDEVICE
|
RAWINPUTDEVICE
|
||||||
RAWINPUTHEADER
|
RAWINPUTHEADER
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
<PackageVersion Include="hyjiacan.pinyin4net" Version="4.1.1" />
|
<PackageVersion Include="hyjiacan.pinyin4net" Version="4.1.1" />
|
||||||
<PackageVersion Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
<PackageVersion Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
||||||
<PackageVersion Include="LazyCache" Version="2.4.0" />
|
<PackageVersion Include="LazyCache" Version="2.4.0" />
|
||||||
<PackageVersion Include="Mages" Version="2.0.2" />
|
<PackageVersion Include="Mages" Version="3.0.0" />
|
||||||
<PackageVersion Include="Markdig.Signed" Version="0.34.0" />
|
<PackageVersion Include="Markdig.Signed" Version="0.34.0" />
|
||||||
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
||||||
<PackageVersion Include="MessagePack" Version="2.5.187" />
|
<PackageVersion Include="MessagePack" Version="2.5.187" />
|
||||||
|
@@ -1315,7 +1315,7 @@ EXHIBIT A -Mozilla Public License.
|
|||||||
- hyjiacan.pinyin4net 4.1.1
|
- hyjiacan.pinyin4net 4.1.1
|
||||||
- Interop.Microsoft.Office.Interop.OneNote 1.1.0.2
|
- Interop.Microsoft.Office.Interop.OneNote 1.1.0.2
|
||||||
- LazyCache 2.4.0
|
- LazyCache 2.4.0
|
||||||
- Mages 2.0.2
|
- Mages 3.0.0
|
||||||
- Markdig.Signed 0.34.0
|
- Markdig.Signed 0.34.0
|
||||||
- MessagePack 2.5.187
|
- MessagePack 2.5.187
|
||||||
- Microsoft.Bcl.AsyncInterfaces 9.0.0
|
- Microsoft.Bcl.AsyncInterfaces 9.0.0
|
||||||
|
@@ -192,6 +192,11 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
|||||||
[DataRow("cos", false)]
|
[DataRow("cos", false)]
|
||||||
[DataRow("abs", false)]
|
[DataRow("abs", false)]
|
||||||
[DataRow("1+1.1e3", true)]
|
[DataRow("1+1.1e3", true)]
|
||||||
|
[DataRow("randi(8)", true)]
|
||||||
|
[DataRow("randi()", false)]
|
||||||
|
[DataRow("randi(0.5)", true)]
|
||||||
|
[DataRow("rand()", true)]
|
||||||
|
[DataRow("rand(0.5)", false)]
|
||||||
public void InputValid_TestValid_WhenCalled(string input, bool valid)
|
public void InputValid_TestValid_WhenCalled(string input, bool valid)
|
||||||
{
|
{
|
||||||
// Act
|
// Act
|
||||||
|
@@ -15,7 +15,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
|||||||
@"^(" +
|
@"^(" +
|
||||||
@"%|" +
|
@"%|" +
|
||||||
@"ceil\s*\(|floor\s*\(|exp\s*\(|max\s*\(|min\s*\(|abs\s*\(|log(?:2|10)?\s*\(|ln\s*\(|sqrt\s*\(|pow\s*\(|" +
|
@"ceil\s*\(|floor\s*\(|exp\s*\(|max\s*\(|min\s*\(|abs\s*\(|log(?:2|10)?\s*\(|ln\s*\(|sqrt\s*\(|pow\s*\(|" +
|
||||||
@"factorial\s*\(|sign\s*\(|round\s*\(|rand\s*\(|" +
|
@"factorial\s*\(|sign\s*\(|round\s*\(|rand\s*\(\)|randi\s*\([^\)]|" +
|
||||||
@"sin\s*\(|cos\s*\(|tan\s*\(|arcsin\s*\(|arccos\s*\(|arctan\s*\(|" +
|
@"sin\s*\(|cos\s*\(|tan\s*\(|arcsin\s*\(|arccos\s*\(|arctan\s*\(|" +
|
||||||
@"sinh\s*\(|cosh\s*\(|tanh\s*\(|arsinh\s*\(|arcosh\s*\(|artanh\s*\(|" +
|
@"sinh\s*\(|cosh\s*\(|tanh\s*\(|arsinh\s*\(|arcosh\s*\(|artanh\s*\(|" +
|
||||||
@"pi|" +
|
@"pi|" +
|
||||||
|
Reference in New Issue
Block a user