
    jY	                     T    S SK Jr  S SKJrJr  \" \S:  S5       " S S\5      5       rg)    )version_info)TestCaseskipIf)   
   zPython >= 3.10 onlyc                   D    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
rg)	TestMatch   c                 j    U R                  S5        U R                  S5        U R                  S5        g )Nz
            def f():
                x = 1
                match x:
                    case 1 as y:
                        print(f'matched as {y}')
        z
            def f():
                x = [1, 2, 3]
                match x:
                    case [1, y, 3]:
                        print(f'matched {y}')
        z
            def f():
                x = {'foo': 1}
                match x:
                    case {'foo': y}:
                        print(f'matched {y}')
        flakesselfs    P/var/www/html/KUNJ/venv/lib/python3.13/site-packages/pyflakes/test/test_match.pytest_match_bindingsTestMatch.test_match_bindings   s9      	 	  	 	  	    c                 H    U R                  S5        U R                  S5        g )Nz
            from a import B

            match 1:
                case B(x=1) as y:
                    print(f'matched {y}')
        z
            from a import B

            match 1:
                case B(a, x=z) as y:
                    print(f'matched {y} {a} {z}')
        r   r   s    r    test_match_pattern_matched_class*TestMatch.test_match_pattern_matched_class   s&      	 	  	r   c                 &    U R                  S5        g )Nz~
            def f():
                match 1:
                    case _:
                        print('catchall!')
        r   r   s    r   test_match_placeholder TestMatch.test_match_placeholder/         	r   c                 &    U R                  S5        g )Nz[
            match 1:
                case True:
                    print('true')
        r   r   s    r   test_match_singletonTestMatch.test_match_singleton7         	r   c                 &    U R                  S5        g )Nzb
            match 1:
                case 1 | 2:
                    print('one or two')
        r   r   s    r   test_match_or_patternTestMatch.test_match_or_pattern>   r   r   c                 &    U R                  S5        g )Nz
            x = [1, 2, 3]
            match x:
                case [1, *y]:
                    print(f'captured: {y}')
        r   r   s    r   test_match_starTestMatch.test_match_starE   r   r   c                 &    U R                  S5        g )Nz
            x = {'foo': 'bar', 'baz': 'womp'}
            match x:
                case {'foo': k1, **rest}:
                    print(f'{k1=} {rest=}')
        r   r   s    r   test_match_double_star TestMatch.test_match_double_starM   r   r   c                 &    U R                  S5        g )Nz
            def f(x):
                match x:
                    case 1:
                        def y(): pass
                    case _:
                        def y(): print(1)
                return y
        r   r   s    r   "test_defined_in_different_branches,TestMatch.test_defined_in_different_branchesU   s      	r    N)__name__
__module____qualname____firstlineno__r   r   r   r   r    r#   r&   r)   __static_attributes__r+   r   r   r	   r	      s*    . 	r   r	   N)sysr   pyflakes.test.harnessr   r   r	   r+   r   r   <module>r3      s6     2 w 56W W 7Wr   