53 references to TestPropertyFunction
Microsoft.Build.Engine.UnitTests (53)
Evaluation\Expander_Tests.cs (53)
4446TestPropertyFunction("$(prop.IndexOfAny('y'))", "prop", "x-y-z", "2");
4452TestPropertyFunction("$(prop.LastIndexOf('y'))", "prop", "x-x-y-y-y-z", "8");
4454TestPropertyFunction("$(prop.LastIndexOf('y', 7))", "prop", "x-x-y-y-y-z", "6");
4460TestPropertyFunction("$(prop.LastIndexOfAny('xy'))", "prop", "x-x-y-y-y-z", "8");
4469TestPropertyFunction(propertyFunction,
4476TestPropertyFunction(@"$([System.Version]::Parse('$(X)').ToString(1))", "X", "4.0", "4");
4516TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory()));
4522TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32()));
4528TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64()));
4534TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath()));
4544TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetVsInstallRoot())", "X", "_", vsInstallRoot);
4550TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath()));
4556TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32()));
4562TestPropertyFunction("$(prop.Split('-')[0])", "prop", "x-y-z", "x");
4568TestPropertyFunction("$(prop.Substring(2))", "prop", "abcdef", "cdef");
4574TestPropertyFunction("$(prop.Substring(2, 3))", "prop", "abcdef", "cde");
4580TestPropertyFunction("$(prop[0])", "prop", "461", "4");
4588TestPropertyFunction("$(prop[5])", "prop", "461", "4");
4595TestPropertyFunction("$(prop.PadLeft(2))", "prop", "x", " x");
4601TestPropertyFunction("$(prop.PadLeft(2, '0'))", "prop", "x", "0x");
4607TestPropertyFunction("$(prop.PadLeft($([MSBuild]::Multiply(1, 2)), '0'))", "prop", "x", "0x");
4613TestPropertyFunction("$(VersionSuffixBuildOfTheDay.PadLeft(3, $([System.Convert]::ToChar(`0`))))", "VersionSuffixBuildOfTheDay", "4", "004");
4619TestPropertyFunction("$(prop.PadRight(2))", "prop", "x", "x ");
4625TestPropertyFunction("$(prop.PadRight(2, '0'))", "prop", "x", "x0");
4631TestPropertyFunction("$(prop.TrimEnd('.0123456789'))", "prop", "net461", "net");
4637TestPropertyFunction("$(X.TrimStart('vV'))", "X", "v40", "40");
4643TestPropertyFunction("$(X.TrimStart(vV))", "X", "v40", "40");
4649TestPropertyFunction("$(prop.TrimEnd('a'))", "prop", "netaa", "net");
4656TestPropertyFunction("$([System.Math]::Max($(X), 0))", "X", "-2010", "0");
4664TestPropertyFunction("$(prop.TrimEnd('a', 'b'))", "prop", "stringab", "string");
4671TestPropertyFunction("$([System.Math]::Min($(X), 20))", "X", "30", "20");
4677TestPropertyFunction("$([MSBuild]::Add($(X), 5))", "X", "7", "12");
4683TestPropertyFunction("$([MSBuild]::Add($(X), 0.5))", "X", "7", "7.5");
4691TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", long.MaxValue.ToString(), expected);
4701TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", value.ToString(), expected.ToString());
4707TestPropertyFunction("$([MSBuild]::Add($(X), $([MSBuild]::Add(2, 3))))", "X", "7", "12");
4713TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000))", "X", "20100042", "42");
4719TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000.0))", "X", "20100042", "42");
4727TestPropertyFunction("$([MSBuild]::Subtract($(X), 9223372036854775806))", "X", long.MaxValue.ToString(), expected);
4733TestPropertyFunction("$([MSBuild]::Multiply($(X), 8800))", "X", "2", "17600");
4739TestPropertyFunction("$([MSBuild]::Multiply($(X), 1.5))", "X", "2", "3");
4747TestPropertyFunction("$([MSBuild]::Multiply($(X), 2))", "X", long.MaxValue.ToString(), expected);
4753TestPropertyFunction("$([MSBuild]::Multiply($(X), $([MSBuild]::Multiply(1, 8800))))", "X", "2", "17600");
4760TestPropertyFunction("$([MSBuild]::Divide($(X), 10000))", "X", "65536", expected);
4766TestPropertyFunction("$([MSBuild]::Divide($(X), 10000.0))", "X", "65536", "6.5536");
4772TestPropertyFunction("$([MSBuild]::Modulo($(X), 3))", "X", "10", "1");
4778TestPropertyFunction("$([MSBuild]::Modulo($(X), 3.0))", "X", "10", "1");
4784TestPropertyFunction("$([System.Convert]::ToString(`.`))", "_", "_", ".");
4790TestPropertyFunction("$([System.Convert]::ToInt32(42))", "_", "_", "42");
4796TestPropertyFunction("$([System.Convert]::ToString(`.`).ToCharArray())", "_", "_", ".");
4802TestPropertyFunction("$(X.Split($([System.Convert]::ToString(`.`).ToCharArray())).GetValue($([System.Convert]::ToInt32(0))))", "X", "ab.cd", "ab");
4827TestPropertyFunction(expression, "dummy", "", expected);
4868TestPropertyFunction($"$([MSBuild]::FilterTargetFrameworks('{incoming}', '{filter}'))", "_", "_", expected);