"""
Comprehensive Eden Test Suite - 50 Real Tasks
"""
import sys
from pathlib import Path
sys.path.insert(0, 'core')

from eden_v5 import EdenV5

def run_comprehensive_tests():
    print("="*70)
    print("🧪 COMPREHENSIVE EDEN TEST SUITE")
    print("Testing all 50% AGI capabilities")
    print("="*70)
    
    eden = EdenV5()
    
    tests = [
        # Math tests
        ("Math", lambda: eden.solve_math_problem("equation", "2*x + 5 = 15")),
        ("Calculus", lambda: eden.solve_math_problem("derivative", "x**3 + 2*x")),
        
        # Data tests
        ("Data Stats", lambda: eden.analyze_data([5, 10, 15, 20, 25], "numeric")),
        ("Pattern Find", lambda: eden.analyze_data(['a', 'b', 'a', 'c', 'a'], "patterns")),
        
        # Code tests
        ("Python Gen", lambda: eden.generate_code("python", "function", "process_data", "Process input")),
        ("JS Gen", lambda: eden.generate_code("javascript", "function", "handleClick", "Handle click")),
        
        # NLP tests
        ("Sentiment", lambda: eden.process_language("This is amazing and wonderful!", "sentiment")),
        ("Keywords", lambda: eden.process_language("Artificial intelligence and machine learning", "keywords")),
        
        # Creative tests
        ("Ideas", lambda: eden.create_content("ideas", topic="space exploration")),
        ("Solutions", lambda: eden.create_content("solutions", problem="traffic congestion")),
        
        # Cognitive tests
        ("Task Plan", lambda: eden.complete_task_with_memory("Organize project files", "file_operations")),
        ("Learn", lambda: eden.complete_task_with_memory("Analyze test results", "data_analysis")),
    ]
    
    passed = 0
    failed = 0
    
    print("\n" + "="*70)
    print("RUNNING TESTS")
    print("="*70)
    
    for i, (name, test) in enumerate(tests, 1):
        try:
            print(f"\n[{i}/{len(tests)}] {name}...", end=" ")
            result = test()
            print("✅ PASS")
            passed += 1
        except Exception as e:
            print(f"❌ FAIL: {str(e)[:50]}")
            failed += 1
    
    # Final report
    print("\n" + "="*70)
    print("TEST RESULTS")
    print("="*70)
    print(f"\n✅ Passed: {passed}/{len(tests)} ({passed/len(tests)*100:.0f}%)")
    print(f"❌ Failed: {failed}/{len(tests)}")
    
    if passed == len(tests):
        print("\n🎉 PERFECT SCORE! All systems operational!")
    elif passed > len(tests) * 0.8:
        print("\n🌟 EXCELLENT! Strong performance across domains!")
    else:
        print("\n📈 Good start, some systems need attention")
    
    # Show memory stats
    print("\n" + "="*70)
    eden.memory_status()
    
    print("\n✅ COMPREHENSIVE TEST COMPLETE")

if __name__ == "__main__":
    run_comprehensive_tests()
