Exemple #1
0
        public void parseMSBuildUnloopingTest6()
        {
            var env     = new StubEnv();
            var uvar    = new UserVariable();
            var msbuild = new vsCE.MSBuild.Parser(env, uvar);
            var sbe     = new Script(env, uvar);

            string data = "#[var test = #[($(test) == \""+ vsCE.MSBuild.Parser.PROP_VALUE_DEFAULT + "\"){0}else{$(test)}]]#[var test]";
            Assert.AreEqual("0", msbuild.parse(sbe.parse(data, true)));
            Assert.AreEqual("0", msbuild.parse(sbe.parse(data, true)));

            uvar.set("test", null, "7");
            uvar.evaluate("test", null, new EvaluatorBlank(), true);
            Assert.AreEqual("7", msbuild.parse(sbe.parse(data, true)));
        }
Exemple #2
0
        public void parseMSBuildUnloopingTest5()
        {
            var env     = new StubEnv();
            var uvar    = new UserVariable();
            var msbuild = new vsCE.MSBuild.Parser(env, uvar);
            var sbe     = new Script(env, uvar);

            msbuild.parse(sbe.parse("#[var test = $$(test)]#[var test = 1 $(test) 2]", true));

            uvar.unsetAll();
            msbuild.parse(sbe.parse("#[var test = $$(test)]#[var test = 1 $(test.Replace('1', '2')) 2]", true));

            uvar.unsetAll();
            msbuild.parse(sbe.parse("#[var test = $(test)]#[var test = 1 $(test) 2]", true));
        }
Exemple #3
0
        public void parseMSBuildUnloopingTest2()
        {
            var env     = new StubEnv();
            var uvar    = new UserVariable();
            var msbuild = new vsCE.MSBuild.Parser(env, uvar);
            var sbe     = new Script(env, uvar);

            msbuild.parse(sbe.parse("#[var p1 = $$(p4)]#[var p2 = $$(p3)]#[var p3 = $$(p1)]#[var p4 = $(p2)]", true));
        }
Exemple #4
0
        public void parseMSBuildUnloopingTest4()
        {
            var env     = new StubEnv();
            var uvar    = new UserVariable();
            var msbuild = new vsCE.MSBuild.Parser(env, uvar);
            var sbe     = new Script(env, uvar);

            msbuild.parse(sbe.parse("#[var p2 = $$(p1) to $$(p8), and new ($$(p7.Replace('1', '2'))) s$$(p9)]#[var p6 = $$(p2)]#[var p7 = $$(p5)]#[var p5 = $(p6)]", true));
            Assert.IsTrue(true); // no problems for stack & heap
        }
        public void startUpProjectTest3()
        {
            IEnvironment env    = new StubEnv();
            var target          = new InternalComponent(env);
            string defProject   = env.StartupProjectString;

            Assert.AreEqual(String.Empty, target.parse("[Core StartUpProject = project1]"));
            Assert.AreEqual("project1", env.StartupProjectString);
            Assert.AreEqual(env.StartupProjectString, target.parse("[Core StartUpProject]"));

            Assert.AreEqual(String.Empty, target.parse("[Core StartUpProject =]"));
            Assert.AreEqual(defProject, env.StartupProjectString);
            Assert.AreEqual(env.StartupProjectString, target.parse("[Core StartUpProject]"));
        }