52 references to TestPropertyFunction
Microsoft.Build.Engine.UnitTests (52)
Evaluation\Expander_Tests.cs (52)
4330TestPropertyFunction("$(prop.IndexOfAny('y'))", "prop", "x-y-z", "2");
4336TestPropertyFunction("$(prop.LastIndexOf('y'))", "prop", "x-x-y-y-y-z", "8");
4338TestPropertyFunction("$(prop.LastIndexOf('y', 7))", "prop", "x-x-y-y-y-z", "6");
4344TestPropertyFunction("$(prop.LastIndexOfAny('xy'))", "prop", "x-x-y-y-y-z", "8");
4353TestPropertyFunction(propertyFunction,
4360TestPropertyFunction(@"$([System.Version]::Parse('$(X)').ToString(1))", "X", "4.0", "4");
4400TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory()));
4406TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32()));
4412TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64()));
4418TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath()));
4428TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetVsInstallRoot())", "X", "_", vsInstallRoot);
4434TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath()));
4440TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32()));
4446TestPropertyFunction("$(prop.Split('-')[0])", "prop", "x-y-z", "x");
4452TestPropertyFunction("$(prop.Substring(2))", "prop", "abcdef", "cdef");
4458TestPropertyFunction("$(prop.Substring(2, 3))", "prop", "abcdef", "cde");
4464TestPropertyFunction("$(prop[0])", "prop", "461", "4");
4472TestPropertyFunction("$(prop[5])", "prop", "461", "4");
4479TestPropertyFunction("$(prop.PadLeft(2))", "prop", "x", " x");
4485TestPropertyFunction("$(prop.PadLeft(2, '0'))", "prop", "x", "0x");
4491TestPropertyFunction("$(prop.PadLeft($([MSBuild]::Multiply(1, 2)), '0'))", "prop", "x", "0x");
4497TestPropertyFunction("$(VersionSuffixBuildOfTheDay.PadLeft(3, $([System.Convert]::ToChar(`0`))))", "VersionSuffixBuildOfTheDay", "4", "004");
4503TestPropertyFunction("$(prop.PadRight(2))", "prop", "x", "x ");
4509TestPropertyFunction("$(prop.PadRight(2, '0'))", "prop", "x", "x0");
4515TestPropertyFunction("$(prop.TrimEnd('.0123456789'))", "prop", "net461", "net");
4521TestPropertyFunction("$(X.TrimStart('vV'))", "X", "v40", "40");
4527TestPropertyFunction("$(X.TrimStart(vV))", "X", "v40", "40");
4533TestPropertyFunction("$(prop.TrimEnd('a'))", "prop", "netaa", "net");
4540TestPropertyFunction("$([System.Math]::Max($(X), 0))", "X", "-2010", "0");
4548TestPropertyFunction("$(prop.TrimEnd('a', 'b'))", "prop", "stringab", "string");
4555TestPropertyFunction("$([System.Math]::Min($(X), 20))", "X", "30", "20");
4561TestPropertyFunction("$([MSBuild]::Add($(X), 5))", "X", "7", "12");
4567TestPropertyFunction("$([MSBuild]::Add($(X), 0.5))", "X", "7", "7.5");
4575TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", long.MaxValue.ToString(), expected);
4584TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", value.ToString(), expected.ToString());
4590TestPropertyFunction("$([MSBuild]::Add($(X), $([MSBuild]::Add(2, 3))))", "X", "7", "12");
4596TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000))", "X", "20100042", "42");
4602TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000.0))", "X", "20100042", "42");
4610TestPropertyFunction("$([MSBuild]::Subtract($(X), 9223372036854775806))", "X", long.MaxValue.ToString(), expected);
4616TestPropertyFunction("$([MSBuild]::Multiply($(X), 8800))", "X", "2", "17600");
4622TestPropertyFunction("$([MSBuild]::Multiply($(X), 1.5))", "X", "2", "3");
4630TestPropertyFunction("$([MSBuild]::Multiply($(X), 2))", "X", long.MaxValue.ToString(), expected);
4636TestPropertyFunction("$([MSBuild]::Multiply($(X), $([MSBuild]::Multiply(1, 8800))))", "X", "2", "17600");
4643TestPropertyFunction("$([MSBuild]::Divide($(X), 10000))", "X", "65536", expected);
4649TestPropertyFunction("$([MSBuild]::Divide($(X), 10000.0))", "X", "65536", "6.5536");
4655TestPropertyFunction("$([MSBuild]::Modulo($(X), 3))", "X", "10", "1");
4661TestPropertyFunction("$([MSBuild]::Modulo($(X), 3.0))", "X", "10", "1");
4667TestPropertyFunction("$([System.Convert]::ToString(`.`))", "_", "_", ".");
4673TestPropertyFunction("$([System.Convert]::ToInt32(42))", "_", "_", "42");
4679TestPropertyFunction("$([System.Convert]::ToString(`.`).ToCharArray())", "_", "_", ".");
4685TestPropertyFunction("$(X.Split($([System.Convert]::ToString(`.`).ToCharArray())).GetValue($([System.Convert]::ToInt32(0))))", "X", "ab.cd", "ab");
4707TestPropertyFunction($"$([MSBuild]::FilterTargetFrameworks('{incoming}', '{filter}'))", "_", "_", expected);