class Tryouts::PrismParser

def build_test_case(block)

def build_test_case(block)
  case block
  in {
    type: :test,
    description: String => desc,
    code: Array => code_tokens,
    expectations: Array => exp_tokens,
    start_line: Integer => start_line,
    end_line: Integer => end_line
  }
    # Extract source lines from the original source during parsing
    source_lines = @lines[start_line..end_line]
    TestCase.new(
      description: desc,
      code: extract_code_content(code_tokens),
      expectations: exp_tokens.map { |token| token[:content] },
      line_range: start_line..end_line,
      path: @source_path,
      source_lines: source_lines,
    )
  else
    raise "Invalid test block structure: #{block}"
  end
end