# Test Interactive CLI
# This script tests the interactive mode of osynic-sl CLI
$exePath = ".\target\release\osynic-sl.exe"
$outputDir = ".\test_output"
Write-Host "🎵 Testing Interactive CLI Mode" -ForegroundColor Cyan
Write-Host "================================" -ForegroundColor Cyan
# Create test output directory if not exists
if (-not (Test-Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
}
# Test 1: Interactive mode without any arguments
Write-Host "`n✅ Test 1: Running with minimal arguments (will prompt for selections)" -ForegroundColor Yellow
Write-Host "Note: This test simulates user input through stdin" -ForegroundColor Gray
# Prepare test input (songs, osudb, use detected path, ./test_output)
# Note: In a real scenario, this would be interactive
# For CI/automated testing, you might want to add a --non-interactive flag
Write-Host "`n✅ Test 2: Running with all parameters specified" -ForegroundColor Yellow
$jsonType = "songs"
$algorithm = "osudb"
$osuPath = "C:\Users\$env:USERNAME\AppData\Local\osu!"
$outputPath = $outputDir
# Check if osu! path exists
if (Test-Path $osuPath) {
Write-Host "Found osu! at: $osuPath" -ForegroundColor Green
# Run with all parameters (non-interactive)
& $exePath -t $jsonType -a $algorithm -p $osuPath -o $outputPath
if ($LASTEXITCODE -eq 0) {
Write-Host "`n✅ CLI execution succeeded!" -ForegroundColor Green
Write-Host "Output files:"
Get-ChildItem -Path $outputDir -Filter "*.json" | ForEach-Object {
Write-Host " - $($_.Name) (Size: $($_.Length) bytes)" -ForegroundColor Gray
}
} else {
Write-Host "`n❌ CLI execution failed with exit code: $LASTEXITCODE" -ForegroundColor Red
}
} else {
Write-Host "⚠️ osu! installation not found at: $osuPath" -ForegroundColor Yellow
Write-Host "Showing help instead..." -ForegroundColor Gray
& $exePath --help
}