public void ParseUnloopingTest4() { var target = new EvMSBuilderAcs(); Assert.Throws <LimitException>(() => { // p4 -> p2 -> p3 -> p1 -> p4 target.Eval("$(p4 = $$(p2))$(p3 = $$(p1))$(p2 = $$(p3))$(p1 = $$(p4))$(p4)"); }); }
public void QuotesTest4() { var target = new EvMSBuilderAcs(); target.UVars.SetVariable("name", "project", "test123"); target.UVars.Evaluate("name", "project", new EvaluatorBlank(), true); //Assert.Equal("test123", target.parse("$([System.String]::Concat('$(name:project)'))")); //TODO: read note from hquotes Assert.Equal("test123", target.Eval("$([System.String]::Concat(\"$(name:project)\"))")); // $([System.DateTime]::Parse(\"$([System.DateTime]::UtcNow.Ticks)\").ToBinary()) }
public void QuotesTest11() { var target = new EvMSBuilderAcs(); Assert.Equal("simply \"text\" data", target.Eval("simply \"text\" data")); Assert.Equal("simply \\\"text\\\" data", target.Eval("simply \\\"text\\\" data")); Assert.Equal("simply \\\\\"text\\\\\" data", target.Eval("simply \\\\\"text\\\\\" data")); Assert.Equal("simply 'text' data", target.Eval("simply 'text' data")); Assert.Equal("simply \'text\' data", target.Eval("simply \'text\' data")); Assert.Equal("simply \\'text\\' data", target.Eval("simply \\'text\\' data")); }
public void QuotesTest10() { var target = new EvMSBuilderAcs(); target.UVars.SetVariable("name", null, "test123"); target.UVars.Evaluate("name", null, new EvaluatorBlank(), true); Assert.Equal("test123)", target.Eval("$([System.String]::Concat(\"$(name))\"))")); Assert.Equal("(test123", target.Eval("$([System.String]::Concat(\"($(name)\"))")); Assert.Equal("(test123", target.Eval("$([System.String]::Concat('($(name)'))")); Assert.Equal("test123)", target.Eval("$([System.String]::Concat('$(name))'))")); Assert.Equal(" left ) test123 ", target.Eval("$([System.String]::Concat(\" left ) $(name) \"))")); Assert.Equal(" left ) test123 ", target.Eval("$([System.String]::Concat(' left ) $(name) '))")); Assert.Equal(" left () test123 ", target.Eval("$([System.String]::Concat(\" left () $(name) \"))")); Assert.Equal(" left () test123 ", target.Eval("$([System.String]::Concat(' left () $(name) '))")); }
public void ParseUnloopingTest8() { var target = new EvMSBuilderAcs(); Assert.Equal("7", target.Eval("$(test = 7)$(test = $(test))$(test)")); }
public void ParseUnloopingTest5() { var target = new EvMSBuilderAcs(); Assert.Equal(EvMSBuilder.UNDEF_VAL, target.Eval("$(p2 = $$(p1))$(p6 = $$(p2))$(p7 = $$(p5))$(p5 = $(p6))$(p5)")); }