53 references to TestPropertyFunction
Microsoft.Build.Engine.UnitTests (53)
Evaluation\Expander_Tests.cs (53)
4388TestPropertyFunction("$(prop.IndexOfAny('y'))", "prop", "x-y-z", "2"); 4394TestPropertyFunction("$(prop.LastIndexOf('y'))", "prop", "x-x-y-y-y-z", "8"); 4396TestPropertyFunction("$(prop.LastIndexOf('y', 7))", "prop", "x-x-y-y-y-z", "6"); 4402TestPropertyFunction("$(prop.LastIndexOfAny('xy'))", "prop", "x-x-y-y-y-z", "8"); 4411TestPropertyFunction(propertyFunction, 4418TestPropertyFunction(@"$([System.Version]::Parse('$(X)').ToString(1))", "X", "4.0", "4"); 4458TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory())); 4464TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32())); 4470TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64())); 4476TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath())); 4486TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetVsInstallRoot())", "X", "_", vsInstallRoot); 4492TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath())); 4498TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32())); 4504TestPropertyFunction("$(prop.Split('-')[0])", "prop", "x-y-z", "x"); 4510TestPropertyFunction("$(prop.Substring(2))", "prop", "abcdef", "cdef"); 4516TestPropertyFunction("$(prop.Substring(2, 3))", "prop", "abcdef", "cde"); 4522TestPropertyFunction("$(prop[0])", "prop", "461", "4"); 4530TestPropertyFunction("$(prop[5])", "prop", "461", "4"); 4537TestPropertyFunction("$(prop.PadLeft(2))", "prop", "x", " x"); 4543TestPropertyFunction("$(prop.PadLeft(2, '0'))", "prop", "x", "0x"); 4549TestPropertyFunction("$(prop.PadLeft($([MSBuild]::Multiply(1, 2)), '0'))", "prop", "x", "0x"); 4555TestPropertyFunction("$(VersionSuffixBuildOfTheDay.PadLeft(3, $([System.Convert]::ToChar(`0`))))", "VersionSuffixBuildOfTheDay", "4", "004"); 4561TestPropertyFunction("$(prop.PadRight(2))", "prop", "x", "x "); 4567TestPropertyFunction("$(prop.PadRight(2, '0'))", "prop", "x", "x0"); 4573TestPropertyFunction("$(prop.TrimEnd('.0123456789'))", "prop", "net461", "net"); 4579TestPropertyFunction("$(X.TrimStart('vV'))", "X", "v40", "40"); 4585TestPropertyFunction("$(X.TrimStart(vV))", "X", "v40", "40"); 4591TestPropertyFunction("$(prop.TrimEnd('a'))", "prop", "netaa", "net"); 4598TestPropertyFunction("$([System.Math]::Max($(X), 0))", "X", "-2010", "0"); 4606TestPropertyFunction("$(prop.TrimEnd('a', 'b'))", "prop", "stringab", "string"); 4613TestPropertyFunction("$([System.Math]::Min($(X), 20))", "X", "30", "20"); 4619TestPropertyFunction("$([MSBuild]::Add($(X), 5))", "X", "7", "12"); 4625TestPropertyFunction("$([MSBuild]::Add($(X), 0.5))", "X", "7", "7.5"); 4633TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", long.MaxValue.ToString(), expected); 4643TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", value.ToString(), expected.ToString()); 4649TestPropertyFunction("$([MSBuild]::Add($(X), $([MSBuild]::Add(2, 3))))", "X", "7", "12"); 4655TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000))", "X", "20100042", "42"); 4661TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000.0))", "X", "20100042", "42"); 4669TestPropertyFunction("$([MSBuild]::Subtract($(X), 9223372036854775806))", "X", long.MaxValue.ToString(), expected); 4675TestPropertyFunction("$([MSBuild]::Multiply($(X), 8800))", "X", "2", "17600"); 4681TestPropertyFunction("$([MSBuild]::Multiply($(X), 1.5))", "X", "2", "3"); 4689TestPropertyFunction("$([MSBuild]::Multiply($(X), 2))", "X", long.MaxValue.ToString(), expected); 4695TestPropertyFunction("$([MSBuild]::Multiply($(X), $([MSBuild]::Multiply(1, 8800))))", "X", "2", "17600"); 4702TestPropertyFunction("$([MSBuild]::Divide($(X), 10000))", "X", "65536", expected); 4708TestPropertyFunction("$([MSBuild]::Divide($(X), 10000.0))", "X", "65536", "6.5536"); 4714TestPropertyFunction("$([MSBuild]::Modulo($(X), 3))", "X", "10", "1"); 4720TestPropertyFunction("$([MSBuild]::Modulo($(X), 3.0))", "X", "10", "1"); 4726TestPropertyFunction("$([System.Convert]::ToString(`.`))", "_", "_", "."); 4732TestPropertyFunction("$([System.Convert]::ToInt32(42))", "_", "_", "42"); 4738TestPropertyFunction("$([System.Convert]::ToString(`.`).ToCharArray())", "_", "_", "."); 4744TestPropertyFunction("$(X.Split($([System.Convert]::ToString(`.`).ToCharArray())).GetValue($([System.Convert]::ToInt32(0))))", "X", "ab.cd", "ab"); 4769TestPropertyFunction(expression, "dummy", "", expected); 4791TestPropertyFunction($"$([MSBuild]::FilterTargetFrameworks('{incoming}', '{filter}'))", "_", "_", expected);