public void parseTest10() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(Path.Replace('\\', '/'))"; Assert.AreEqual("[E~Path.Replace('\\', '/')~]", target.parse(data)); }
public void parseNestedTest9() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$([System.TimeSpan]::FromTicks($([MSBuild]::Subtract($([System.DateTime]::UtcNow.Ticks), $([System.DateTime]::Parse('27.03.2015').ToBinary())))).TotalMinutes.ToString(\"0\"))"; Assert.AreEqual("[E~[System.TimeSpan]::FromTicks([E~[MSBuild]::Subtract([E~[System.DateTime]::UtcNow.Ticks~], [E~[System.DateTime]::Parse('27.03.2015').ToBinary()~])~]).TotalMinutes.ToString(\"0\")~]", target.parse(data)); }
public void parseNestedTest1() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = @"$(var.Method('str1', $(OS:$($(data.Replace('\', '/')):project2)), 'str2'):project)"; Assert.AreEqual(@"[E~var.Method('str1', [E~OS:[E~[E~data.Replace('\', '/')~]~project2]~], 'str2')~project]", target.parse(data)); }
public void parseVarAndDataTest4() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$$(var = $(Path:project))"; Assert.AreEqual("$(var = $(Path:project))", target.parse(data)); }
public void parseNestedTest2() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = @"$(var.Method('str1', $(OS:$($(data.Method2):project2)), 'str2'):project)"; Assert.AreEqual(@"[E~var.Method('str1', [P~OS~[E~[E~data.Method2~]~project2]], 'str2')~project]", target.parse(data)); }
public void parseNestedTest3() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var.Method('str1', $(OS:$($([System.DateTime]::Parse(\"27.03.2015\").ToBinary()):project2)), 'str2'):project)"; Assert.AreEqual("[E~var.Method('str1', [E~OS:[E~[E~[System.DateTime]::Parse(\"27.03.2015\").ToBinary()~]~project2]~], 'str2')~project]", target.parse(data)); }
public void parseNestedTest4() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var.Method('str1', $(OS:$($(test.Ticks):project2)), \\\"str2\\\"):project)"; Assert.AreEqual("[E~var.Method('str1', [P~OS~[E~[E~test.Ticks~]~project2]], \\\"str2\\\")~project]", target.parse(data)); }
public void parseNestedTest8() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$([System.DateTime]::Parse(' left $([System.DateTime]::UtcNow.Ticks) right').ToBinary())"; Assert.AreEqual("[E~[System.DateTime]::Parse(' left $([System.DateTime]::UtcNow.Ticks) right').ToBinary()~]", target.parse(data)); }
public void parseNestedTest6() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$([System.DateTime]::Parse(\"01.01.2000\").ToBinary())"; Assert.AreEqual("[E~[System.DateTime]::Parse(\"01.01.2000\").ToBinary()~]", target.parse(data)); }
public void parseWrappingTest4() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$($(Path:project))"; string actual = target.parse(data); Assert.IsTrue("[E~[P~Path~project]~]" == actual || "[P~[P~Path~project]~]" == actual); }
public void parseStringTest4() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = ' $(Path:project) ')"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual(" $(Path:project) ", target.uvariable.get("var")); }
public void parseStringTest2() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = \" mixed $(Path:project) \" )"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual(" mixed [P~Path~project] ", target.uvariable.get("var")); }
public void parseStringTest7() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = \"$(Path.Replace(\\'1\\', \\'2\\'))\")"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual("[E~Path.Replace(\\'1\\', \\'2\\')~]", target.uvariable.get("var")); }
public void parseStringTest9() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = @"$(var = $(Path.Replace(\'1\', '2')))"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual(@"[E~Path.Replace(\'1\', '2')~]", target.uvariable.get("var")); }
public void parseStringTest10() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = $(Path.Replace(\\\"1\\\", \"2\")))"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual("[E~Path.Replace(\\\"1\\\", \"2\")~]", target.uvariable.get("var")); }
public void parseEscapeAndVarTest8() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(p2 = $$$$(Platform))"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual("$$$(Platform)", target.uvariable.get("p2")); }
public void parseVarAndDataTest5() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = $(Path:project))"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual("[P~Path~project]", target.uvariable.get("var")); }
public void parseVarAndDataTest1() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var=$(Path.Replace('\\', '/')):project)"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual(null, target.uvariable.get("var")); Assert.AreEqual("[E~Path.Replace('\\', '/')~]", target.uvariable.get("var", "project")); }
public void parseNestedTest5() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var.Method('str1', $(OS:$($(data):project2)), \\\"str2\\\"):project)"; string actual = target.parse(data); Assert.IsTrue("[E~var.Method('str1', [P~OS~[E~[P~data~]~project2]], \\\"str2\\\")~project]" == actual || "[E~var.Method('str1', [P~OS~[P~[P~data~]~project2]], \\\"str2\\\")~project]" == actual); }
public void parseStringTest3() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); Assert.AreEqual(String.Empty, target.parse("$(var = \" $$(Path:project) \")")); Assert.AreEqual(" $(Path:project) ", target.uvariable.get("var")); Assert.AreEqual(String.Empty, target.parse("$(var = ' $$(Path:project) ')")); Assert.AreEqual(" $$(Path:project) ", target.uvariable.get("var")); }
public void parseStringTest11() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); Assert.AreEqual("", target.parse("$(name = ' test 12345 -_*~!@#$%^&= :) ')")); Assert.AreEqual(" test 12345 -_*~!@#$%^&= :) ", target.uvariable.get("name")); Assert.AreEqual("", target.parse("$(name = ' $( -_*~!@#$%^&= :) ')")); Assert.AreEqual(" $( -_*~!@#$%^&= :) ", target.uvariable.get("name")); }
public void parseVarAndDataTest6() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var=$(Path:project2):project)"; Assert.IsTrue(target.uvariable.Variables.Count() < 1); Assert.AreEqual("", target.parse(data)); Assert.AreEqual("[P~Path~project2]", target.uvariable.get("var", "project")); Assert.IsTrue(target.uvariable.Variables.Count() == 1); }
public void parseEscapeAndVarTest10() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); /* $(p1 = $(Platform)) $$(p1) */ string data = "$(p1 = $(Platform))$$(p1)"; Assert.AreEqual("$(p1)", target.parse(data)); Assert.AreEqual("[P~Platform~]", target.uvariable.get("p1")); }
public void parseStringTest15() { var target = new MSBuildParserAccessor.ToParse(); Assert.AreEqual(String.Empty, target.parse("$(name = \" left $(Path:project) right \" )")); Assert.AreEqual(" left [P~Path~project] right ", target.uvariable.get("name")); Assert.AreEqual(String.Empty, target.parse("$(name = \" left \\\"$(Path)\\\" right \" )")); Assert.AreEqual(" left \"[P~Path~]\" right ", target.uvariable.get("name")); Assert.AreEqual(String.Empty, target.parse("$(name = \" \\'left\\' $(Path:project) 'right' \" )")); Assert.AreEqual(" \\'left\\' [P~Path~project] 'right' ", target.uvariable.get("name")); }
public void parseEscapeAndVarTest10() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); /* * $(p1 = $(Platform)) * $$(p1) */ string data = "$(p1 = $(Platform))$$(p1)"; Assert.AreEqual("$(p1)", target.parse(data)); Assert.AreEqual("[P~Platform~]", target.uvariable.get("p1")); }
public void parseStringTest12() { var target = new MSBuildParserAccessor.ToParse(); Assert.AreEqual(String.Empty, target.parse("$(name = 'left\\'right')")); Assert.AreEqual("left'right", target.uvariable.get("name")); Assert.AreEqual(String.Empty, target.parse("$(name = \"left\\'right\")")); Assert.AreEqual("left\\'right", target.uvariable.get("name")); Assert.AreEqual(String.Empty, target.parse("$(name = 'left\\\"right')")); Assert.AreEqual("left\\\"right", target.uvariable.get("name")); Assert.AreEqual(String.Empty, target.parse("$(name = \"left\\\"right\")")); Assert.AreEqual("left\"right", target.uvariable.get("name")); }
public void parseStringTest14() { var target = new MSBuildParserAccessor.ToParse(); target.parse("$(name = \"left\"right\")"); }
public void parseTest9() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(Path.Replace('\\\\', '/'))"; Assert.AreEqual("[E~Path.Replace('\\\\', '/')~]", target.parse(data)); }
public void parseStringTest13() { var target = new MSBuildParserAccessor.ToParse(); target.parse("$(name = 'left'right')"); }
public void parseStringTest8() { MSBuildParserAccessor.ToParse target = new MSBuildParserAccessor.ToParse(); string data = "$(var = \"$(Path.Replace(\\\"1\\\", \\\"2\\\"))\")"; Assert.AreEqual("", target.parse(data)); Assert.AreEqual("[E~Path.Replace(\"1\", \"2\")~]", target.uvariable.get("var")); }