#!/usr/bin/env python3
"""Integration test for selector filtering."""

def test():
    from pywasot.facade import parse_wasot_string
    
    # Test content
    content = ".doc\n..section\n...p\nHello\n../"
    
    # Test without selectors
    all_events = list(parse_wasot_string(content))
    print(f"Without selectors: {len(all_events)} events")
    
    # Test with selector
    p_events = list(parse_wasot_string(content, selectors=["p"]))
    print(f"With 'p' selector: {len(p_events)} events")
    
    # Test with complex selector
    nested_events = list(parse_wasot_string(content, selectors=["section p"]))
    print(f"With 'section p' selector: {len(nested_events)} events")
    
    assert len(all_events) > len(p_events), "Filtering should reduce events"
    assert len(p_events) == len(nested_events), "Both selectors should match the paragraph"
    
    print("✅ All integration tests passed!")

if __name__ == "__main__":
    test()