class Tryouts::CLI::CompactFormatter

def test_result(result_packet, io = $stdout)

def test_result(result_packet, io = $stdout)
  # Only show failed tests in compact mode unless show_passed is true
  return if result_packet.passed? && !@show_passed
  test_case = result_packet.test_case
  desc = test_case.description.to_s
  desc = 'unnamed test' if desc.empty?
  case result_packet.status
  when :passed
    status = Console.color(:green, '✓')
    io.puts indent_text("#{status} #{desc}", 1)
  when :failed
    status = Console.color(:red, '✗')
    io.puts indent_text("#{status} #{desc}", 1)
    # Show minimal context for failures
    if result_packet.actual_results.any?
      failure_info = "got: #{result_packet.first_actual.inspect}"
      io.puts indent_text("    #{failure_info}", 1)
    end
    # Show 1-2 lines of test context if available
    if test_case.source_lines && test_case.source_lines.size <= 3
      test_case.source_lines.each do |line|
        next if line.strip.empty? || line.strip.start_with?('#')
        io.puts indent_text("    #{line.strip}", 1)
        break # Only show first relevant line
      end
    end
  when :skipped
    status = Console.color(:yellow, '-')
    io.puts indent_text("#{status} #{desc}", 1)
  else
    status = '?'
    io.puts indent_text("#{status} #{desc}", 1)
  end
end