mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun][UnitConverter]Add support for sq prefix for square units (#37862)
* [PTRun][UnitConverter]Add support for `sq` prefix for square quantities
This commit is contained in:
@@ -71,13 +71,23 @@ namespace Community.PowerToys.Run.Plugin.UnitConverter.UnitTest
|
||||
[DataRow(new string[] { "5", "f", "in", "celsius" }, new string[] { "5", "°F", "in", "DegreeCelsius" })]
|
||||
[DataRow(new string[] { "5", "c", "in", "f" }, new string[] { "5", "°C", "in", "°F" })]
|
||||
[DataRow(new string[] { "5", "f", "in", "c" }, new string[] { "5", "°F", "in", "°C" })]
|
||||
#pragma warning restore CA1861 // Avoid constant arrays as arguments
|
||||
public void PrefixesDegrees(string[] input, string[] expectedResult)
|
||||
{
|
||||
InputInterpreter.DegreePrefixer(ref input);
|
||||
CollectionAssert.AreEqual(expectedResult, input);
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow(new string[] { "7", "cm/sqs", "in", "m/s^2" }, new string[] { "7", "cm/s²", "in", "m/s^2" })]
|
||||
[DataRow(new string[] { "7", "sqft", "in", "sqcm" }, new string[] { "7", "ft²", "in", "cm²" })]
|
||||
[DataRow(new string[] { "7", "BTU/s·sqin", "in", "cal/h·sqcm" }, new string[] { "7", "BTU/s·in²", "in", "cal/h·cm²" })]
|
||||
#pragma warning restore CA1861 // Avoid constant arrays as arguments
|
||||
public void HandlesSquareNotation(string[] input, string[] expectedResult)
|
||||
{
|
||||
InputInterpreter.SquareHandler(ref input);
|
||||
CollectionAssert.AreEqual(expectedResult, input);
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow("a f in c")]
|
||||
[DataRow("12 f in")]
|
||||
|
||||
Reference in New Issue
Block a user