예제 #1
0
        public void TestParseArgsWithDoubleDashInProcArgs()
        {
            var procArgs = new string[] { "/bin/cat", "--" };
            var args     = new[] { "--" }.Concat(procArgs).ToArray();
            var result   = SandboxExecRunner.ParseArgs(args);

            XAssert.AreEqual(Defaults, result.toolOptions);
            XAssert.ArrayEqual(procArgs, result.procArgs);
        }
예제 #2
0
        public void TestParseArgsWithTwoToolArgs(string arg1, string arg2, bool?expectedVerboseValue, int?expectedQueueSizeValue)
        {
            var procArgs = new string[] { "/bin/cat", "--" };
            var args     = new[] { arg1, arg2, "--" }.Concat(procArgs).ToArray();
            var result   = SandboxExecRunner.ParseArgs(args);

            XAssert.AreEqual(expectedVerboseValue ?? Defaults.Verbose, result.toolOptions.Verbose);
            XAssert.AreEqual(expectedQueueSizeValue ?? (int)Defaults.ReportQueueSizeMB, (int)result.toolOptions.ReportQueueSizeMB);
            XAssert.ArrayEqual(procArgs, result.procArgs);
        }
예제 #3
0
        public void TestParseArgsNoToolArgs(bool withSeparator)
        {
            var procArgs = new string[] { "/bin/ls", "-l" };
            var args     = withSeparator
                ? new[] { "--" }.Concat(procArgs).ToArray()
                : procArgs;
            var result = SandboxExecRunner.ParseArgs(args);

            XAssert.AreEqual(Defaults, result.toolOptions);
            XAssert.ArrayEqual(procArgs, result.procArgs);
        }