#!/bin/bash # Debug the actual test execution PROJECT_ROOT="/data/emu/rom-groomer" # Source the test framework source "$PROJECT_ROOT/tests/test-framework.sh" # Setup init_test_framework # Create test directory TEST_INPUT_DIR="$TEST_TEMP_DIR/input" mkdir -p "$TEST_INPUT_DIR" # Create invalid ZIP echo "PK this is not a valid zip file" > "$TEST_INPUT_DIR/invalid.zip" echo "=== Running the actual test code ===" echo "Testing invalid ZIP file: $TEST_INPUT_DIR/invalid.zip" # Run exactly what the test does output=$("$PROJECT_ROOT/converters/convertFromZipCueToOggCue.sh" "$TEST_INPUT_DIR/invalid.zip" 2>&1) exit_code=$? echo "Exit code captured: $exit_code" echo "Output length: ${#output}" echo "First 100 chars of output: ${output:0:100}" # Test the assertion echo "=== Testing assertion ===" echo "Expected: NOT 0" echo "Actual: $exit_code" if [ "$exit_code" != "0" ]; then echo "✓ Test should PASS" else echo "✗ Test should FAIL" fi # Cleanup cleanup_test_framework