[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:
Родитель
1eec678276
Коммит
94d712135c
|
@ -1213,6 +1213,7 @@ QUEUESYNC
|
|||
QUNS
|
||||
RAII
|
||||
RAlt
|
||||
randi
|
||||
Rasterize
|
||||
RAWINPUTDEVICE
|
||||
RAWINPUTHEADER
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<PackageVersion Include="hyjiacan.pinyin4net" Version="4.1.1" />
|
||||
<PackageVersion Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
||||
<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" />
|
||||
<!-- 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" />
|
||||
|
|
|
@ -1315,7 +1315,7 @@ EXHIBIT A -Mozilla Public License.
|
|||
- hyjiacan.pinyin4net 4.1.1
|
||||
- Interop.Microsoft.Office.Interop.OneNote 1.1.0.2
|
||||
- LazyCache 2.4.0
|
||||
- Mages 2.0.2
|
||||
- Mages 3.0.0
|
||||
- Markdig.Signed 0.34.0
|
||||
- MessagePack 2.5.187
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.0
|
||||
|
|
|
@ -192,6 +192,11 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
|||
[DataRow("cos", false)]
|
||||
[DataRow("abs", false)]
|
||||
[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)
|
||||
{
|
||||
// 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*\(|" +
|
||||
@"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*\(|" +
|
||||
@"sinh\s*\(|cosh\s*\(|tanh\s*\(|arsinh\s*\(|arcosh\s*\(|artanh\s*\(|" +
|
||||
@"pi|" +
|
||||
|
|
Загрузка…
Ссылка в новой задаче