+
    Bio#                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt  ! R R]P                  4      t ! R R] P                  4      t ! R	 R
]P                  4      t ! R R] P                  4      t]P&                  ! 4        ! R R]P                  4      4       tR t]R8X  d<   R]P.                  9   d   ]! 4       P1                  4        R# ]P2                  ! 4        R# R# )    N)support)ensure_lazy_importsimport_module)run_ptyc                   D   a  ] tR t^t o ]P
                  R 4       tRtV tR# )LazyImportTestc                "    \        R RR04       R# )cmdinspectstringN)r   selfs   &$/usr/lib/python3.14/test/test_cmd.pytest_lazy_importLazyImportTest.test_lazy_import   s    EIx#89     N)	__name__
__module____qualname____firstlineno__r   cpython_onlyr   __static_attributes____classdictcell____classdict__s   @r   r   r      s     : :r   r   c                   \   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tRtV tR# )samplecmdclassc                    \        R 4       R# )zHello from preloopNprintr   s   &r   preloopsamplecmdclass.preloop   s    "#r   c                    \        R 4       R# )zHello from postloopNr    r   s   &r   postloopsamplecmdclass.postloop   s    #$r   c                    \        R 4       R# )z"This is the completedefault methodNr    )r   ignoreds   &*r   completedefaultsamplecmdclass.completedefault   s    23r   c                    \        R 4       R# )zcomplete commandNr    r   s   &r   complete_commandsamplecmdclass.complete_command   s     !r   c                    R # Nr   )r   ss   &&r   do_shellsamplecmdclass.do_shell   s    r   c                   VP                  4       p\        V4      ^8w  d   \        R4       R#  V Uu. uF  p\        V4      NK  	  pp\        T^ ,          T^,          ,           4       R# u upi   \         d    \        R4        R# i ; i)   z*** invalid number of argumentsNz*** arguments should be numbers)splitlenr!   int
ValueError)r   r0   lis   &&  r   do_addsamplecmdclass.do_add   sw    GGIq6Q;34	!"#AQA# 	ad1Q4i	 $ 	34	s"   A0 A+A0 +A0 0B
	B
c                    \        R 4       R# )zhelp text for addNr    r   s   &r   help_addsamplecmdclass.help_add   s    !"r   c                    \        R 4       R# )zTry and be nice to people, avoid eating fat, read a good book every now and then, get some walking in, and try to live together in peace and harmony with people of all creeds and nations.Nr    r   s   &r   help_meaningsamplecmdclass.help_meaning   s     2 	3 	r   c                    \        R 4       R# )z&Always look on the bright side of lifeNr    r   s   &r   	help_lifesamplecmdclass.help_life   s    67r   c                    R # Tr   )r   args   &&r   do_exitsamplecmdclass.do_exit   s    r   r   N)r   r   r   r   r"   r%   r)   r,   r1   r;   r>   rA   rD   rI   r   r   r   s   @r   r   r      s=     P$%4"
 r   r   c                   l   a  ] tR t^t o  ! R R]P
                  4      t ! R R]4      tR tR t	Rt
V tR# )	TestAlternateInputc                   ,   a  ] tR t^t o R tR tRtV tR# )TestAlternateInput.simplecmdc                2    \        WP                  R 7       R# )fileNr!   stdoutr   argss   &&r   do_print%TestAlternateInput.simplecmd.do_print   s    $[[)r   c                    R # rG   r   rT   s   &&r   do_EOF#TestAlternateInput.simplecmd.do_EOF   s    r   r   N)r   r   r   r   rV   rY   r   r   r   s   @r   	simplecmdrN      s     	*	 	r   r[   c                   &   a  ] tR t^t o R tRtV tR# )TestAlternateInput.simplecmd2c                4    \        R V P                  R7       R# )z*** Unknown syntax: EOFrP   TrR   rT   s   &&r   rY   $TestAlternateInput.simplecmd2.do_EOF   s    +$++>r   r   N)r   r   r   r   rY   r   r   r   s   @r   
simplecmd2r]      s     	 	r   r`   c                    \         P                  ! R 4      p\         P                  ! 4       pV P                  WR7      pRVn        VP                  ! 4        V P                  VP                  4       R4       R# )print test
print test2stdinrS   Fz(Cmd) test
(Cmd) test2
(Cmd) N)ioStringIOr[   use_rawinputcmdloopassertMultiLineEqualgetvaluer   inputoutputr
   s   &   r   test_file_with_missing_final_nl2TestAlternateInput.test_file_with_missing_final_nl   sY    56nn5n8 !!&//"3	r   c                   \         P                  ! R 4      p\         P                  ! 4       pV P                  WR7      pRVn        VP                  ! 4        V P                  VP                  4       R4       \         P                  ! R4      p\         P                  ! 4       pWn        W#n        VP                  ! 4        V P                  VP                  4       R4       R# )rb   rc   Fz5(Cmd) test
(Cmd) test2
(Cmd) *** Unknown syntax: EOF
zprint 

z,(Cmd) 
(Cmd) 
(Cmd) *** Unknown syntax: EOF
N)	re   rf   r`   rg   rh   ri   rj   rd   rS   rk   s   &   r   test_input_reset_at_EOF*TestAlternateInput.test_input_reset_at_EOF   s    56ooEo9 !!&//"3/	1 L)	
!!&//"3/	1r   r   N)r   r   r   r   r
   Cmdr[   r`   rn   rq   r   r   r   s   @r   rL   rL      s0     CGG Y 	1 1r   rL   c                   &   a  ] tR tRt o R tRtV tR# )CmdPrintExceptionClass   c                P    \        \        P                  ! 4       R ,          4       R# ):Nr4   NN)r!   sysexc_info)r   lines   &&r   defaultCmdPrintExceptionClass.default  s    cllnR !r   r   N)r   r   r   r   r{   r   r   r   s   @r   ru   ru      s     " "r   ru   c                   2   a  ] tR tRt o R tR tR tRtV tR# )CmdTestReadlinei  c                     \        R 4      p R# )readlineN)r   )r   s    r   
setUpClassCmdTestReadline.setUpClass  s     !,r   c                    \         P                  ! R 4      pRp\        W4      pV P                  RV4       V P                  RV4       R# )z
            import cmd
            class simplecmd(cmd.Cmd):
                def do_tab_completion_test(self, args):
                    print('tab completion success')
                    return True

            simplecmd().cmdloop()
        s   t	
s   ab_completion_test   tab completion successN)textwrapdedentr   assertInr   scriptrl   rm   s   &   r   test_basic_completion%CmdTestReadline.test_basic_completion  sD     "  '+V4/8r   c                   \         P                  ! R 4      pR FU  pV P                  VR7      ;_uu_ 4        \        W4      pV P	                  RV4       V P	                  RV4       RRR4       KW  	  R#   + '       g   i     Kl  ; i)a  
            import cmd
            class simplecmd(cmd.Cmd):
                def completedefault(self, text, line, begidx, endidx):
                    return ["hello"]

                def default(self, line):
                    if line.replace(" ", "") == "!hello":
                        print('tab completion success')
                    else:
                        print('tab completion failure')
                    return True

            simplecmd().cmdloop()
        )rl   s   hellor   N)s   ! h	
s   !h	
)r   r   subTestr   r   r   s   &   r   %test_bang_completion_without_do_shell5CmdTestReadline.test_bang_completion_without_do_shell*  sk     " " -EE** /h/7@ +* -***s   0A44Br   N)	r   r   r   r   r   r   r   r   r   r   s   @r   r~   r~     s     -
9&A Ar   r~   c                 N    VP                  \        P                  ! 4       4       V# r/   )addTestdoctestDocTestSuite)loadertestspatterns   &&&r   
load_testsr   B  s    	MM'&&()Lr   __main__z-i)r
   rx   r   unittestre   r   testr   test.support.import_helperr   r   test.support.pty_helperr   TestCaser   rs   r   rL   ru   requires_subprocessr~   r   r   argvrh   mainr   r   r   <module>r      s     
   	   I +:X&& :sSWW sl01** 01f"SWW "  	/Ah'' /A /Ab
 zsxx  "	 r   