示例#1
0
        public void TestMultipleCommandsSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test1 && test2");

            AssertList(commands, "test1", "test2");
        }
示例#2
0
        public void TestMultipleCommandsWithArgSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test1 --arg1 && test2 --arg2");

            AssertList(commands, "test1 --arg1", "test2 --arg2");
        }
示例#3
0
        public void TestSingleCommandWithArgsSingleQuotesAndInnerQuotesSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test --arg1 'argument \"&&\" quotes'");

            AssertList(commands, "test --arg1 'argument \"&&\" quotes'");
        }
示例#4
0
        public void TestSingleCommandWithArgsQuotesAndInnerSingleQuotesSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test --arg1 \"argument '&&' quotes\"");

            AssertList(commands, "test --arg1 \"argument '&&' quotes\"");
        }
示例#5
0
        public void TestSingleCommandWithArgsSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test --arg1 --arg2");

            AssertList(commands, "test --arg1 --arg2");
        }
示例#6
0
        public void TestSingleCommandSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test");

            AssertList(commands, "test");
        }
示例#7
0
        public void TestMoar()
        {
            IList <string> commands = CCommandSplitter.Split("bind t 'echo \"test-1\" && echo \"test-2\"'");

            AssertList(commands, "bind t 'echo \"test-1\" && echo \"test-2\"'");
        }
示例#8
0
        public void TestMultipleCommandsWithArgsSingleQuotesAndInnerQuotesSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test1 --arg1 'a1 \"&&\" a2' && test2 --arg2 'b1 \"&&\" b2'");

            AssertList(commands, "test1 --arg1 'a1 \"&&\" a2'", "test2 --arg2 'b1 \"&&\" b2'");
        }
示例#9
0
        public void TestMultipleCommandsWithArgsQuotesAndInnerQuotesSplit()
        {
            IList <string> commands = CCommandSplitter.Split("test1 --arg1 \"a1 \\\"&&\\\" a2\" && test2 --arg2 \"b1 \\\"&&\\\" b2\"");

            AssertList(commands, "test1 --arg1 \"a1 \\\"&&\\\" a2\"", "test2 --arg2 \"b1 \\\"&&\\\" b2\"");
        }