#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" source "$SCRIPT_DIR/../harness/helpers.sh" setup_test_env trap teardown_test_env EXIT # Generate syntactically invalid TOML (unclosed section header, unclosed string). source "$HARNESS_DIR/config-gen.sh" _gen_broken_config bad_toml # The binary should fail to parse the config and exit non-zero. output=$("$WARPGATE_BIN" status -c "$TEST_CONFIG" 2>&1) && { echo "FAIL: warpgate status should have exited non-zero for bad TOML" echo " output: $output" exit 1 } # The error should contain the standard config parse failure message. assert_output_contains "$output" "Failed to parse config TOML" echo "PASS: $(basename "$0" .sh)"