import sys
import os

# Add backend to path
sys.path.append(os.path.join(os.getcwd(), 'backend'))

from lib.metric_parser import MetricParser

def test_parser():
    parser = MetricParser()
    
    test_cases = [
        ("80 (2020)", 80.0),
        ("80 (Stand 2022)", 80.0),
        ("1.005 Mitarbeiter", 1005.0),
        ("375,6 Mio. €", 375.6),
        ("ca. 50.000 m²", 50000.0)
    ]
    
    for text, expected in test_cases:
        result = parser.extract_numeric(text)
        print(f"Input: '{text}' -> Result: {result} (Expected: {expected})")
        if result != expected:
            print("  FAILED")
        else:
            print("  PASSED")

if __name__ == "__main__":
    test_parser()
