Beispiel #1
0
        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)");
            });
        }
Beispiel #2
0
        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())
        }
Beispiel #3
0
        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"));
        }
Beispiel #4
0
        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) '))"));
        }
Beispiel #5
0
        public void ParseUnloopingTest8()
        {
            var target = new EvMSBuilderAcs();

            Assert.Equal("7", target.Eval("$(test = 7)$(test = $(test))$(test)"));
        }
Beispiel #6
0
        public void ParseUnloopingTest5()
        {
            var target = new EvMSBuilderAcs();

            Assert.Equal(EvMSBuilder.UNDEF_VAL, target.Eval("$(p2 = $$(p1))$(p6 = $$(p2))$(p7 = $$(p5))$(p5 = $(p6))$(p5)"));
        }