53 references to TestPropertyFunction
Microsoft.Build.Engine.UnitTests (53)
Evaluation\Expander_Tests.cs (53)
4453TestPropertyFunction("$(prop.IndexOfAny('y'))", "prop", "x-y-z", "2"); 4459TestPropertyFunction("$(prop.LastIndexOf('y'))", "prop", "x-x-y-y-y-z", "8"); 4461TestPropertyFunction("$(prop.LastIndexOf('y', 7))", "prop", "x-x-y-y-y-z", "6"); 4467TestPropertyFunction("$(prop.LastIndexOfAny('xy'))", "prop", "x-x-y-y-y-z", "8"); 4476TestPropertyFunction(propertyFunction, 4483TestPropertyFunction(@"$([System.Version]::Parse('$(X)').ToString(1))", "X", "4.0", "4"); 4523TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory())); 4529TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32())); 4535TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64())); 4541TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath())); 4551TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetVsInstallRoot())", "X", "_", vsInstallRoot); 4557TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath())); 4563TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32())); 4569TestPropertyFunction("$(prop.Split('-')[0])", "prop", "x-y-z", "x"); 4575TestPropertyFunction("$(prop.Substring(2))", "prop", "abcdef", "cdef"); 4581TestPropertyFunction("$(prop.Substring(2, 3))", "prop", "abcdef", "cde"); 4587TestPropertyFunction("$(prop[0])", "prop", "461", "4"); 4595TestPropertyFunction("$(prop[5])", "prop", "461", "4"); 4602TestPropertyFunction("$(prop.PadLeft(2))", "prop", "x", " x"); 4608TestPropertyFunction("$(prop.PadLeft(2, '0'))", "prop", "x", "0x"); 4614TestPropertyFunction("$(prop.PadLeft($([MSBuild]::Multiply(1, 2)), '0'))", "prop", "x", "0x"); 4620TestPropertyFunction("$(VersionSuffixBuildOfTheDay.PadLeft(3, $([System.Convert]::ToChar(`0`))))", "VersionSuffixBuildOfTheDay", "4", "004"); 4626TestPropertyFunction("$(prop.PadRight(2))", "prop", "x", "x "); 4632TestPropertyFunction("$(prop.PadRight(2, '0'))", "prop", "x", "x0"); 4638TestPropertyFunction("$(prop.TrimEnd('.0123456789'))", "prop", "net461", "net"); 4644TestPropertyFunction("$(X.TrimStart('vV'))", "X", "v40", "40"); 4650TestPropertyFunction("$(X.TrimStart(vV))", "X", "v40", "40"); 4656TestPropertyFunction("$(prop.TrimEnd('a'))", "prop", "netaa", "net"); 4663TestPropertyFunction("$([System.Math]::Max($(X), 0))", "X", "-2010", "0"); 4671TestPropertyFunction("$(prop.TrimEnd('a', 'b'))", "prop", "stringab", "string"); 4678TestPropertyFunction("$([System.Math]::Min($(X), 20))", "X", "30", "20"); 4684TestPropertyFunction("$([MSBuild]::Add($(X), 5))", "X", "7", "12"); 4690TestPropertyFunction("$([MSBuild]::Add($(X), 0.5))", "X", "7", "7.5"); 4698TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", long.MaxValue.ToString(), expected); 4708TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", value.ToString(), expected.ToString()); 4714TestPropertyFunction("$([MSBuild]::Add($(X), $([MSBuild]::Add(2, 3))))", "X", "7", "12"); 4720TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000))", "X", "20100042", "42"); 4726TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000.0))", "X", "20100042", "42"); 4734TestPropertyFunction("$([MSBuild]::Subtract($(X), 9223372036854775806))", "X", long.MaxValue.ToString(), expected); 4740TestPropertyFunction("$([MSBuild]::Multiply($(X), 8800))", "X", "2", "17600"); 4746TestPropertyFunction("$([MSBuild]::Multiply($(X), 1.5))", "X", "2", "3"); 4754TestPropertyFunction("$([MSBuild]::Multiply($(X), 2))", "X", long.MaxValue.ToString(), expected); 4760TestPropertyFunction("$([MSBuild]::Multiply($(X), $([MSBuild]::Multiply(1, 8800))))", "X", "2", "17600"); 4767TestPropertyFunction("$([MSBuild]::Divide($(X), 10000))", "X", "65536", expected); 4773TestPropertyFunction("$([MSBuild]::Divide($(X), 10000.0))", "X", "65536", "6.5536"); 4779TestPropertyFunction("$([MSBuild]::Modulo($(X), 3))", "X", "10", "1"); 4785TestPropertyFunction("$([MSBuild]::Modulo($(X), 3.0))", "X", "10", "1"); 4791TestPropertyFunction("$([System.Convert]::ToString(`.`))", "_", "_", "."); 4797TestPropertyFunction("$([System.Convert]::ToInt32(42))", "_", "_", "42"); 4803TestPropertyFunction("$([System.Convert]::ToString(`.`).ToCharArray())", "_", "_", "."); 4809TestPropertyFunction("$(X.Split($([System.Convert]::ToString(`.`).ToCharArray())).GetValue($([System.Convert]::ToInt32(0))))", "X", "ab.cd", "ab"); 4834TestPropertyFunction(expression, "dummy", "", expected); 4875TestPropertyFunction($"$([MSBuild]::FilterTargetFrameworks('{incoming}', '{filter}'))", "_", "_", expected);