52 references to TestPropertyFunction
Microsoft.Build.Engine.UnitTests (52)
Evaluation\Expander_Tests.cs (52)
4386TestPropertyFunction("$(prop.IndexOfAny('y'))", "prop", "x-y-z", "2");
4392TestPropertyFunction("$(prop.LastIndexOf('y'))", "prop", "x-x-y-y-y-z", "8");
4394TestPropertyFunction("$(prop.LastIndexOf('y', 7))", "prop", "x-x-y-y-y-z", "6");
4400TestPropertyFunction("$(prop.LastIndexOfAny('xy'))", "prop", "x-x-y-y-y-z", "8");
4409TestPropertyFunction(propertyFunction,
4416TestPropertyFunction(@"$([System.Version]::Parse('$(X)').ToString(1))", "X", "4.0", "4");
4456TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetCurrentToolsDirectory())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetCurrentToolsDirectory()));
4462TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory32()));
4468TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetToolsDirectory64())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetToolsDirectory64()));
4474TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildSDKsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildSDKsPath()));
4484TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetVsInstallRoot())", "X", "_", vsInstallRoot);
4490TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetMSBuildExtensionsPath())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetMSBuildExtensionsPath()));
4496TestPropertyFunction("$([Microsoft.Build.Evaluation.IntrinsicFunctions]::GetProgramFiles32())", "X", "_", EscapingUtilities.Escape(IntrinsicFunctions.GetProgramFiles32()));
4502TestPropertyFunction("$(prop.Split('-')[0])", "prop", "x-y-z", "x");
4508TestPropertyFunction("$(prop.Substring(2))", "prop", "abcdef", "cdef");
4514TestPropertyFunction("$(prop.Substring(2, 3))", "prop", "abcdef", "cde");
4520TestPropertyFunction("$(prop[0])", "prop", "461", "4");
4528TestPropertyFunction("$(prop[5])", "prop", "461", "4");
4535TestPropertyFunction("$(prop.PadLeft(2))", "prop", "x", " x");
4541TestPropertyFunction("$(prop.PadLeft(2, '0'))", "prop", "x", "0x");
4547TestPropertyFunction("$(prop.PadLeft($([MSBuild]::Multiply(1, 2)), '0'))", "prop", "x", "0x");
4553TestPropertyFunction("$(VersionSuffixBuildOfTheDay.PadLeft(3, $([System.Convert]::ToChar(`0`))))", "VersionSuffixBuildOfTheDay", "4", "004");
4559TestPropertyFunction("$(prop.PadRight(2))", "prop", "x", "x ");
4565TestPropertyFunction("$(prop.PadRight(2, '0'))", "prop", "x", "x0");
4571TestPropertyFunction("$(prop.TrimEnd('.0123456789'))", "prop", "net461", "net");
4577TestPropertyFunction("$(X.TrimStart('vV'))", "X", "v40", "40");
4583TestPropertyFunction("$(X.TrimStart(vV))", "X", "v40", "40");
4589TestPropertyFunction("$(prop.TrimEnd('a'))", "prop", "netaa", "net");
4596TestPropertyFunction("$([System.Math]::Max($(X), 0))", "X", "-2010", "0");
4604TestPropertyFunction("$(prop.TrimEnd('a', 'b'))", "prop", "stringab", "string");
4611TestPropertyFunction("$([System.Math]::Min($(X), 20))", "X", "30", "20");
4617TestPropertyFunction("$([MSBuild]::Add($(X), 5))", "X", "7", "12");
4623TestPropertyFunction("$([MSBuild]::Add($(X), 0.5))", "X", "7", "7.5");
4631TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", long.MaxValue.ToString(), expected);
4640TestPropertyFunction("$([MSBuild]::Add($(X), 1))", "X", value.ToString(), expected.ToString());
4646TestPropertyFunction("$([MSBuild]::Add($(X), $([MSBuild]::Add(2, 3))))", "X", "7", "12");
4652TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000))", "X", "20100042", "42");
4658TestPropertyFunction("$([MSBuild]::Subtract($(X), 20100000.0))", "X", "20100042", "42");
4666TestPropertyFunction("$([MSBuild]::Subtract($(X), 9223372036854775806))", "X", long.MaxValue.ToString(), expected);
4672TestPropertyFunction("$([MSBuild]::Multiply($(X), 8800))", "X", "2", "17600");
4678TestPropertyFunction("$([MSBuild]::Multiply($(X), 1.5))", "X", "2", "3");
4686TestPropertyFunction("$([MSBuild]::Multiply($(X), 2))", "X", long.MaxValue.ToString(), expected);
4692TestPropertyFunction("$([MSBuild]::Multiply($(X), $([MSBuild]::Multiply(1, 8800))))", "X", "2", "17600");
4699TestPropertyFunction("$([MSBuild]::Divide($(X), 10000))", "X", "65536", expected);
4705TestPropertyFunction("$([MSBuild]::Divide($(X), 10000.0))", "X", "65536", "6.5536");
4711TestPropertyFunction("$([MSBuild]::Modulo($(X), 3))", "X", "10", "1");
4717TestPropertyFunction("$([MSBuild]::Modulo($(X), 3.0))", "X", "10", "1");
4723TestPropertyFunction("$([System.Convert]::ToString(`.`))", "_", "_", ".");
4729TestPropertyFunction("$([System.Convert]::ToInt32(42))", "_", "_", "42");
4735TestPropertyFunction("$([System.Convert]::ToString(`.`).ToCharArray())", "_", "_", ".");
4741TestPropertyFunction("$(X.Split($([System.Convert]::ToString(`.`).ToCharArray())).GetValue($([System.Convert]::ToInt32(0))))", "X", "ab.cd", "ab");
4763TestPropertyFunction($"$([MSBuild]::FilterTargetFrameworks('{incoming}', '{filter}'))", "_", "_", expected);