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); }
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); }
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); }