#!/bin/bash

# Test script to verify CAP LIST functionality
echo "Testing CAP LIST functionality..."

# Connect to server and test CAP negotiation + LIST
{
    echo "CAP LS"
    sleep 0.1
    echo "CAP REQ :away-notify chghost multi-prefix"
    sleep 0.1
    echo "CAP LIST"
    sleep 0.1
    echo "CAP END"
    sleep 0.1
    echo "NICK TestUser"
    sleep 0.1
    echo "USER test 0 * :Test User"
    sleep 0.1
    echo "CAP LIST"
    sleep 0.1
    echo "QUIT :Testing complete"
} | telnet localhost 6667
