+ {
+ "dry-run (tty)",
+ true,
+ false,
+ true,
+ []safcm.CommandChange{
+ {
+ Command: "fake command",
+ Output: "fake output",
+ },
+ },
+ "executed 1 command(s): (dry-run)\n\x1b[36m\"fake command\"\x1b[0m:\n > fake output\n > \\ No newline at end of file\n",
+ },
+
+ {
+ "quiet",
+ false,
+ true,
+ false,
+ []safcm.CommandChange{
+ {
+ Command: "fake command",
+ Output: "fake output",
+ },
+ {
+ Command: "fake command with no output",
+ },
+ {
+ Command: "fake command with newline",
+ Output: "fake output\n",
+ },
+ {
+ Command: "fake command with more output",
+ Output: "fake out\nfake put\nfake\n",
+ },
+ {
+ Command: "fake failed command",
+ Output: "fake output",
+ Error: "fake error",
+ },
+ },
+ `executed 5 command(s), 1 with no output:
+"fake command":
+ > fake output
+ > \ No newline at end of file
+"fake command with newline":
+ > fake output
+"fake command with more output":
+ > fake out
+ > fake put
+ > fake
+"fake failed command", failed: "fake error":
+ > fake output
+ > \ No newline at end of file
+`,
+ },
+
+ {
+ "quiet (tty)",
+ false,
+ true,
+ true,
+ []safcm.CommandChange{
+ {
+ Command: "fake command",
+ Output: "fake output",
+ },
+ {
+ Command: "fake command with no output",
+ },
+ {
+ Command: "fake command with newline",
+ Output: "fake output\n",
+ },
+ {
+ Command: "fake command with more output",
+ Output: "fake out\nfake put\nfake\n",
+ },
+ {
+ Command: "fake failed command",
+ Output: "fake output",
+ Error: "fake error",
+ },
+ },
+ "executed 5 command(s), 1 with no output:\n\x1b[36m\"fake command\"\x1b[0m:\n > fake output\n > \\ No newline at end of file\n\x1b[36m\"fake command with newline\"\x1b[0m:\n > fake output\n\x1b[36m\"fake command with more output\"\x1b[0m:\n > fake out\n > fake put\n > fake\n\x1b[36m\"fake failed command\"\x1b[0m, failed: \"fake error\":\n > fake output\n > \\ No newline at end of file\n",
+ },
+
+ {
+ "quiet (only quiet commands)",
+ false,
+ true,
+ false,
+ []safcm.CommandChange{
+ {
+ Command: "fake command with no output",
+ },
+ {
+ Command: "fake command with no output",
+ },
+ },
+ `executed 2 command(s), 2 with no output
+`,
+ },
+
+ {
+ "quiet (quiet with errors)",
+ false,
+ true,
+ false,
+ []safcm.CommandChange{
+ {
+ Command: "fake command with no output but error",
+ Error: "fake error",
+ },
+ {
+ Command: "fake command with no output",
+ },
+ },
+ `executed 2 command(s), 1 with no output:
+"fake command with no output but error", failed: "fake error"
+`,
+ },
+
+ {
+ "quiet & dry-run",
+ true,
+ true,
+ false,
+ []safcm.CommandChange{
+ {
+ Command: "fake command",
+ },
+ {
+ Command: "fake command with no output",
+ },
+ {
+ Command: "fake command with newline",
+ },
+ {
+ Command: "fake command with more output",
+ },
+ {
+ Command: "fake failed command",
+ },
+ },
+ `executed 5 command(s) (dry-run)
+`,
+ },
+