(t *testing.T)
| 2797 | } |
| 2798 | |
| 2799 | func TestBuildEngineCommandScriptSetup(t *testing.T) { |
| 2800 | setup := buildEngineCommandScriptSetup("/usr/local/bin/custom-copilot") |
| 2801 | |
| 2802 | if !strings.Contains(setup, "umask 0177") { |
| 2803 | t.Fatalf("Expected restrictive umask in script setup, got:\n%s", setup) |
| 2804 | } |
| 2805 | if !strings.Contains(setup, "chmod 700 /tmp/gh-aw/engine-command.sh") { |
| 2806 | t.Fatalf("Expected owner-only execute permissions, got:\n%s", setup) |
| 2807 | } |
| 2808 | if !strings.Contains(setup, "cat > /tmp/gh-aw/engine-command.sh <<'GH_AW_ENGINE_COMMAND_EOF'") { |
| 2809 | t.Fatalf("Expected heredoc-based script materialization, got:\n%s", setup) |
| 2810 | } |
| 2811 | if !strings.Contains(setup, "set -eo pipefail") { |
| 2812 | t.Fatalf("Expected script strict mode without -u, got:\n%s", setup) |
| 2813 | } |
| 2814 | if strings.Contains(setup, "set -euo pipefail") { |
| 2815 | t.Fatalf("Expected script strict mode to drop -u, got:\n%s", setup) |
| 2816 | } |
| 2817 | if !strings.Contains(setup, "set +o histexpand") { |
| 2818 | t.Fatalf("Expected histexpand disabled in engine command script, got:\n%s", setup) |
| 2819 | } |
| 2820 | if !strings.Contains(setup, `/usr/local/bin/custom-copilot "$@"`) { |
| 2821 | t.Fatalf("Expected custom command to forward driver args, got:\n%s", setup) |
| 2822 | } |
| 2823 | } |
| 2824 | |
| 2825 | func TestCopilotSupportsNoAskUser(t *testing.T) { |
| 2826 | defaultSupported := semverutil.Compare( |
nothing calls this directly
no test coverage detected