示例#1
0
        public void TestArglistEscapeSpace()
        {
            Arglist args = new Arglist(@"open C:\\Program\ Files\ (x86)\\UwuCore\\setup.ini");

            Assert.AreEqual(@"open", args.Shift());
            Assert.AreEqual(@"C:\Program Files (x86)\UwuCore\setup.ini", args.Shift());
        }
示例#2
0
        public void TestArglistEscapeNL()
        {
            Arglist args = new Arglist("send 'ls -ltr\n'");

            Assert.AreEqual(@"send", args.Shift());
            Assert.AreEqual("ls -ltr\n", args.Shift());
        }
示例#3
0
        public void TestArglistParsingDQ()
        {
            Arglist args = new Arglist("\"Don't try to stop me!\" SIGTERM");

            Assert.AreEqual(@"Don't try to stop me!", args.Shift());
            Assert.AreEqual(@"SIGTERM", args.Shift());
        }
示例#4
0
        public void TestArglistParsing()
        {
            Arglist args = new Arglist(@"test C:\\Users\\Kevin\\Profile");

            Assert.AreEqual(@"test", args.Shift());
            Assert.AreEqual(@"C:\Users\Kevin\Profile", args.Shift());
        }
示例#5
0
        public void TestArglistEscapeUnicode()
        {
            Arglist args = new Arglist(@"alpha U+03b1 \u03b1");

            Assert.AreEqual(@"alpha", args.Shift());
            Assert.AreEqual(@"U+03b1", args.Shift());
            Assert.AreEqual("\u03b1", args.Shift());
        }
示例#6
0
        public void TestArglistParsingSQ()
        {
            Arglist args = new Arglist("'echo $DISPLAY >>/dev/null' || die");

            Assert.AreEqual(@"echo $DISPLAY >>/dev/null", args.Shift());
            Assert.AreEqual(@"||", args.Shift());
            Assert.AreEqual(@"die", args.Shift());
        }
示例#7
0
        public void TestArglistQuotedInternal()
        {
            Arglist args = new Arglist("'my name'='Joe Bloggs'");

            Assert.AreEqual(@"my name=Joe Bloggs", args.Shift());
        }