#!/usr/bin/env python3
"""Test script for the cprint function"""

from color import Colors, cprint

print("Testing basic colors:")
cprint("Red text", color=Colors.RED)
cprint("Green text", color="green")
cprint("Blue text", color="blue")
cprint("Yellow text", color="yellow")
cprint("Cyan text", color="cyan")
cprint("Magenta text", color="magenta")

print("\nTesting special colors:")
cprint("Warning message", color="warning")
cprint("Success message", color="okgreen")
cprint("Error message", color="fail")
cprint("Header text", color="header")

print("\nTesting bright colors:")
cprint("Bright red", color="bright_red")
cprint("Bright green", color="bright_green")
cprint("Bright blue", color="bright_blue")

print("\nTesting styles:")
cprint("Bold text", color="bold")
cprint("Underlined text", color="underline")

print("\nTesting rainbow effect:")
cprint("This is a rainbow text - every character has a different color!", rainbow=True)
cprint("RAINBOW COLORS ARE AWESOME!", rainbow=True)

print("\nTesting direct color code usage:")
print(
    f"{Colors.OKBLUE}This is blue{Colors.ENDC} and {Colors.WARNING}this is warning{Colors.ENDC}"
)

print("\nTesting without color (normal print):")
cprint("Normal text without any color")

cprint("Testing", "print", "kwargs", color="green", end="\n ----- \n", sep = "😊") 
america = ["red", None, "blue"]
import time
for i in range(10):
    time.sleep(0.2)
    cprint("TESTING FLUSH", color=america[i % len(america)], end="\r", flush=True)
